mirror of
https://github.com/Azure/k8s-set-context.git
synced 2026-04-13 20:12:49 +08:00
* updated action file with node16 * Code consistency using prettier and its workflow * Enforce Prettier * code fix * code fix * code fix Co-authored-by: Vidya Reddy <vidyareddy@microsoft.com>
25 lines
885 B
TypeScript
25 lines
885 B
TypeScript
import {Cluster, parseCluster} from './cluster'
|
|
|
|
describe('Cluster type', () => {
|
|
test('it has required values', () => {
|
|
const vals = <any>Object.values(Cluster)
|
|
expect(vals.includes('arc')).toBe(true)
|
|
expect(vals.includes('generic')).toBe(true)
|
|
})
|
|
|
|
test('it can parse valid values from a string', () => {
|
|
expect(parseCluster('arc')).toBe(Cluster.ARC)
|
|
expect(parseCluster('Arc')).toBe(Cluster.ARC)
|
|
expect(parseCluster('ARC')).toBe(Cluster.ARC)
|
|
|
|
expect(parseCluster('generic')).toBe(Cluster.GENERIC)
|
|
expect(parseCluster('Generic')).toBe(Cluster.GENERIC)
|
|
expect(parseCluster('GENERIC')).toBe(Cluster.GENERIC)
|
|
})
|
|
|
|
test("it will return undefined if it can't parse values from a string", () => {
|
|
expect(parseCluster('invalid')).toBe(undefined)
|
|
expect(parseCluster('unsupportedType')).toBe(undefined)
|
|
})
|
|
})
|