forked from rancher/dashboard
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add CSI suffix to all non-builtin storageClass provisioners (rancher#…
…10348) * add CSI suffix to all non-builtin storageClass provisioners * improve unit test * fix issue with storybook build a spec.ts files * update main.js to exclude * revert changes to storybook config + rewrite unit test --------- Co-authored-by: Alexandre Alves <[email protected]>
- Loading branch information
Showing
2 changed files
with
23 additions
and
1 deletion.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
shell/models/__tests__/storage.k8s.io.storageclass.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import StorageClass, { PROVISIONER_OPTIONS } from '@shell/models/storage.k8s.io.storageclass'; | ||
|
||
describe('class StorageClass', () => { | ||
describe('checking if provisionerDisplay', () => { | ||
it.each([ | ||
['kubernetes.io/azure-disk', true], | ||
['kubernetes.io/portworx-volume', true], | ||
['rancher.io/local-path', false], | ||
['some-random-string-as-provisioner', false], | ||
])('should NOT show a suffix IF they are built-in (on the PROVISIONER_OPTIONS list)', (provisioner, expectation) => { | ||
const storageClass = new StorageClass({ | ||
metadata: {}, | ||
spec: {}, | ||
provisioner | ||
}); | ||
|
||
jest.spyOn(storageClass, '$rootGetters', 'get').mockReturnValue({ 'i18n/t': jest.fn() }); | ||
|
||
expect(!!PROVISIONER_OPTIONS.find((opt) => opt.value === provisioner)).toBe(expectation); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters