k8s-deploy/src/utilities/workflowAnnotationUtils.test.ts
Alexander Bartsch c117b29f9e
consider slashes while cleaning labels (#231)
fix prettier format check errors
2022-08-16 14:28:12 -04:00

21 lines
767 B
TypeScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import {cleanLabel} from '../utilities/workflowAnnotationUtils'
describe('WorkflowAnnotationUtils', () => {
describe('cleanLabel', () => {
it('should clean label', () => {
const alreadyClean = 'alreadyClean'
expect(cleanLabel(alreadyClean)).toEqual(alreadyClean)
expect(cleanLabel('.startInvalid')).toEqual('startInvalid')
expect(cleanLabel('with%S0ME&invalid#chars')).toEqual(
'withS0MEinvalidchars'
)
expect(cleanLabel('with⚒emoji')).toEqual('withemoji')
})
it('should remove slashes from label', () => {
expect(
cleanLabel('Workflow Name / With Slashes / And Spaces')
).toEqual('Workflow_Name_-_With_Slashes_-_And_Spaces')
})
})
})