diff --git a/src/components/IOC/IOCLiveStatus/IOCLiveStatus.spec.js b/src/components/IOC/IOCLiveStatus/IOCLiveStatus.spec.js index a4b03c621390dd493328f38252dc6a0c89b8d60c..d8930101dac273b48e880665899438f6086ddc80 100644 --- a/src/components/IOC/IOCLiveStatus/IOCLiveStatus.spec.js +++ b/src/components/IOC/IOCLiveStatus/IOCLiveStatus.spec.js @@ -13,7 +13,7 @@ function IOCLiveStatusContainer() { const params = useMemo( () => ({ - ioc_id: 2 + ioc_id: 5 }), [] ); @@ -28,11 +28,11 @@ function IOCLiveStatusContainer() { function commonTests() { // Expect IOC name in badge - cy.contains("CCCE:SC-IOC-001"); + cy.contains("CCCE:SC-IOC-005"); // Expected in Info table: - cy.contains("ee3ae2a8"); // git reference - cy.contains("Test IOC for CCCE"); // description + cy.contains("0.0.TEST"); // git reference + cy.contains("Test IOC for CCCE LiveStatus"); // description cy.contains("ccce-w40.cslab.esss.lu.se"); // deployed on // Expect alerts to be displayed diff --git a/src/mocks/fixtures/IOCDetails.json b/src/mocks/fixtures/IOCDetails.json index 5772cafb6c51f2f6d50d3060257b3c928e66a564..ec0d60dbbf24a4af60df8b4f2f3228ad664acf51 100644 --- a/src/mocks/fixtures/IOCDetails.json +++ b/src/mocks/fixtures/IOCDetails.json @@ -1,39 +1,91 @@ [ { "id": 1, - "description": "This is a test IOC for demonstrating the deployment tool", - "createdBy": "johnsparger", - "namingName": "CCCE:SC-IOC-003", + "description": "Test IOC for CCCE", + "createdBy": "johnsmith", + "namingName": "CCCE:SC-IOC-001", "namingUuid": "77325d6f-6d85-443f-b448-3d99a941e23e", "gitProjectId": 5215, - "sourceUrl": "https://gitlab.esss.lu.se/ccce/dev/iocs/e3-ioc-test_49.git", - "sourceVersion": "0.0.1", - "sourceVersionShort": "0.0.1", + "sourceUrl": "https://gitlab.esss.lu.se/ccce/dev/iocs/instances/e3-ioc-test-01.git", + "sourceVersion": "0.0.TEST", + "sourceVersionShort": "0.0.TEST", "activeDeployment": null, "alerts": [], - "operationInProgress": false, + "operationInProgress": true, "active": null }, { "id": 2, - "description": "Test IOC for CCCE", - "createdBy": "johnsparger", + "description": "Test IOC for CCCE Deployable", + "createdBy": "johnsmith", "namingName": "CCCE:SC-IOC-001", - "namingUuid": "d8d674c6-6f1a-467e-abd7-ead80dc82152", - "gitProjectId": 4801, - "sourceUrl": "https://gitlab.esss.lu.se/ccce/dev/iocs/ccce-demo-w38.git", - "sourceVersion": "ee3ae2a8b9e7e83e4eb511eee340716e9d541056", - "sourceVersionShort": "ee3ae2a8", + "namingUuid": "77325d6f-6d85-443f-b448-3d99a941e23e", + "gitProjectId": 5215, + "sourceUrl": "https://gitlab.esss.lu.se/ccce/dev/iocs/instances/e3-ioc-test-01.git", + "sourceVersion": "0.0.TEST", + "sourceVersionShort": "0.0.TEST", + "activeDeployment": null, + "alerts": [], + "operationInProgress": false, + "active": null + }, + { + "id": 3, + "description": "Test IOC for CCCE Deployed", + "createdBy": "johnsmith", + "namingName": "CCCE:SC-IOC-003", + "namingUuid": "77325d6f-6d85-443f-b448-3d99a941e23e", + "gitProjectId": 5215, + "sourceUrl": "https://gitlab.esss.lu.se/ccce/dev/iocs/instances/e3-ioc-test-01.git", + "sourceVersion": "0.0.TEST", + "sourceVersionShort": "0.0.TEST", + "activeDeployment": { + "id": 58, + "createdBy": "johnsmith", + "startDate": "2022-04-06T07:33:50.410+00:00", + "undeployment": false, + "namingName": "CCCE:SC-IOC-003", + "gitProjectId": 5215, + "sourceVersion": "0.0.TEST", + "sourceVersionShort": "0.0.TEST", + "endDate": "2022-01-01T01:01:10.000+00:00", + "iocName": "CCCE:SC-IOC-003", + "host": { + "csEntryId": 4195, + "csEntryIdValid": true, + "fqdn": "ccce-w40.cslab.esss.lu.se", + "hostName": "ccce-w40", + "network": "CSLab-GeneralLab" + }, + "status": "JOB", + "awxJobId": 4544, + "sourceUrl": "https://gitlab.esss.lu.se/ccce/dev/iocs/instances/e3-ioc-test-01.git" + }, + "alerts": [], + "operationInProgress": false, + "active": true + }, + { + "id": 4, + "description": "Test IOC for CCCE Deployed with Errors", + "createdBy": "johnsmith", + "namingName": "CCCE:SC-IOC-004", + "namingUuid": "77325d6f-6d85-443f-b448-3d99a941e23e", + "gitProjectId": 5215, + "sourceUrl": "https://gitlab.esss.lu.se/ccce/dev/iocs/instances/e3-ioc-test-01.git", + "sourceVersion": "0.0.TEST", + "sourceVersionShort": "0.0.TEST", "activeDeployment": { "id": 58, - "createdBy": "johnsparger", + "createdBy": "johnsmith", "startDate": "2022-04-06T07:33:50.410+00:00", "undeployment": false, - "namingName": "CCCE:SC-IOC-001", - "gitProjectId": 4801, - "sourceVersion": "ee3ae2a8b9e7e83e4eb511eee340716e9d541056", - "endDate": "2022-04-06T07:35:20.736+00:00", - "iocName": "CCCE:SC-IOC-001", + "namingName": "CCCE:SC-IOC-004", + "gitProjectId": 5215, + "sourceVersion": "0.0.TEST", + "sourceVersionShort": "0.0.TEST", + "endDate": "2022-01-01T01:01:10.000+00:00", + "iocName": "CCCE:SC-IOC-004", "host": { "csEntryId": 4195, "csEntryIdValid": true, @@ -43,8 +95,7 @@ }, "status": "JOB", "awxJobId": 4544, - "sourceUrl": "https://gitlab.esss.lu.se/ccce/dev/iocs/ccce-demo-w38.git", - "sourceVersionShort": "ee3ae2a8" + "sourceUrl": "https://gitlab.esss.lu.se/ccce/dev/iocs/instances/e3-ioc-test-01.git" }, "alerts": [ { @@ -61,7 +112,49 @@ "active": true }, { - "id": 346, - "description": "Some description" + "id": 5, + "description": "Test IOC for CCCE LiveStatus", + "createdBy": "johnsmith", + "namingName": "CCCE:SC-IOC-005", + "namingUuid": "77325d6f-6d85-443f-b448-3d99a941e23e", + "gitProjectId": 5215, + "sourceUrl": "https://gitlab.esss.lu.se/ccce/dev/iocs/instances/e3-ioc-test-01.git", + "sourceVersion": "0.0.TESTLIVE", + "sourceVersionShort": "0.0.TESTLIVE", + "activeDeployment": { + "id": 58, + "createdBy": "johnsmith", + "startDate": "2022-04-06T07:33:50.410+00:00", + "undeployment": false, + "namingName": "CCCE:SC-IOC-005", + "gitProjectId": 5215, + "sourceVersion": "0.0.TEST", + "sourceVersionShort": "0.0.TEST", + "endDate": "2022-01-01T01:01:10.000+00:00", + "iocName": "CCCE:SC-IOC-005", + "host": { + "csEntryId": 4195, + "csEntryIdValid": true, + "fqdn": "ccce-w40.cslab.esss.lu.se", + "hostName": "ccce-w40", + "network": "CSLab-GeneralLab" + }, + "status": "JOB", + "awxJobId": 4544, + "sourceUrl": "https://gitlab.esss.lu.se/ccce/dev/iocs/instances/e3-ioc-test-01.git" + }, + "alerts": [ + { + "type": "ERROR", + "message": "Example alert without link" + }, + { + "type": "ERROR", + "message": "Example alert with link", + "link": "https://google.com" + } + ], + "operationInProgress": false, + "active": true } ] diff --git a/src/stories/views/IOC/IocDetailsView.stories.js b/src/stories/views/IOC/IocDetailsView.stories.js index fab005ae166cb67a1a7ac8b56108da312afe55b8..887b59ca15fcfe4e2e160d81f0f4c2a4ba14e15a 100644 --- a/src/stories/views/IOC/IocDetailsView.stories.js +++ b/src/stories/views/IOC/IocDetailsView.stories.js @@ -12,17 +12,30 @@ const Template = (args) => ( useTestUser {...args} > - <IOCDetailsContainer id={1} /> + <IOCDetailsContainer id={args.id} /> </AppHarness> ); export const Default = (args) => <Template {...args} />; Default.args = { + id: 1, ...userImpersonatorArgs }; export const Deployable = (args) => <Template {...args} />; Deployable.args = { - id: 2, - ...Default.args + ...Default.args, + id: 2 +}; + +export const Deployed = (args) => <Template {...args} />; +Deployed.args = { + ...Default.args, + id: 3 +}; + +export const DeployedErrors = (args) => <Template {...args} />; +DeployedErrors.args = { + ...Default.args, + id: 4 };