From 779dbd7f55b83d38b40c0601230b29fd25d4f931 Mon Sep 17 00:00:00 2001 From: dingweifeng <1106628276@qq.com> Date: Sat, 18 Jun 2022 23:24:35 +0800 Subject: [PATCH] get-query-params.spec.js%20 this is redundant get-query-params.spec.js%20 this is an redundant file --- .../helpers/get-query-params.spec.js | 81 ------------------- 1 file changed, 81 deletions(-) delete mode 100644 client/routes/namespace/workflow-archival/helpers/get-query-params.spec.js diff --git a/client/routes/namespace/workflow-archival/helpers/get-query-params.spec.js b/client/routes/namespace/workflow-archival/helpers/get-query-params.spec.js deleted file mode 100644 index acf786a8..00000000 --- a/client/routes/namespace/workflow-archival/helpers/get-query-params.spec.js +++ /dev/null @@ -1,81 +0,0 @@ -import getQueryParams from './get-query-params'; - -describe('getQueryParams', () => { - describe('When startTime = undefined and endTime = "2020-03-30T00:00:00Z"', () => { - it('should return null.', () => { - const startTime = undefined; - const endTime = '2020-03-30T00:00:00Z'; - const output = getQueryParams({ endTime, startTime }); - - expect(output).toEqual(null); - }); - }); - - describe('When startTime = "2020-03-01T00:00:00Z" and endTime = undefined', () => { - it('should return null.', () => { - const startTime = '2020-03-01T00:00:00Z'; - const endTime = undefined; - const output = getQueryParams({ endTime, startTime }); - - expect(output).toEqual(null); - }); - }); - - describe('When startTime = "2020-03-01T00:00:00Z" and endTime = "2020-03-30T00:00:00Z"', () => { - let startTime; - let endTime; - - beforeEach(() => { - startTime = '2020-03-01T00:00:00Z'; - endTime = '2020-03-30T00:00:00Z'; - }); - - it('should return startTime.', () => { - const output = getQueryParams({ endTime, startTime }); - - expect(output.startTime).toEqual(startTime); - }); - - it('should return endTime.', () => { - const output = getQueryParams({ endTime, startTime }); - - expect(output.endTime).toEqual(endTime); - }); - - describe('and statusValue = "-1"', () => { - it('should not include status.', () => { - const statusValue = '-1'; - const output = getQueryParams({ endTime, startTime, statusValue }); - - expect(output.status).toEqual(undefined); - }); - }); - - describe('and statusValue = "0"', () => { - it('should return status = "0".', () => { - const statusValue = '0'; - const output = getQueryParams({ endTime, startTime, statusValue }); - - expect(output.status).toEqual('0'); - }); - }); - - describe('and workflowId = "abcd"', () => { - it('should return workflowId = "abcd".', () => { - const workflowId = 'abcd'; - const output = getQueryParams({ endTime, startTime, workflowId }); - - expect(output.workflowId).toEqual('abcd'); - }); - }); - - describe('and workflowName = "workflow.name"', () => { - it('should return workflowName = "workflow.name".', () => { - const workflowName = 'workflow.name'; - const output = getQueryParams({ endTime, startTime, workflowName }); - - expect(output.workflowName).toEqual('workflow.name'); - }); - }); - }); -});