From: Stephen Smith Date: Fri, 28 Oct 2022 14:58:05 +0000 (-0400) Subject: 19315: Show modifiedby from containerRequest and test both equal and different modifi... X-Git-Tag: 2.5.0~27^2~3 X-Git-Url: https://git.arvados.org/arvados-workbench2.git/commitdiff_plain/56c5b7de1410f21a91e18d1c8ff253935948e401 19315: Show modifiedby from containerRequest and test both equal and different modified/runtime uuids Arvados-DCO-1.1-Signed-off-by: Stephen Smith --- diff --git a/cypress/integration/process.spec.js b/cypress/integration/process.spec.js index 838fa9da..90b52aa1 100644 --- a/cypress/integration/process.spec.js +++ b/cypress/integration/process.spec.js @@ -114,19 +114,38 @@ describe('Process tests', function() { }); it('shows process details', function() { - const crName = 'test_container_request'; createContainerRequest( activeUser, - crName, + `test_container_request ${Math.floor(Math.random() * 999999)}`, 'arvados/jobs', ['echo', 'hello world'], false, 'Committed') .then(function(containerRequest) { cy.loginAs(activeUser); cy.goToPath(`/processes/${containerRequest.uuid}`); - cy.get('[data-cy=process-details]').should('contain', crName); - cy.get('[data-cy=process-details-attributes-runtime-user]').contains(`Active User (${activeUser.user.uuid})`); + cy.get('[data-cy=process-details]').should('contain', containerRequest.name); + cy.get('[data-cy=process-details-attributes-modifiedby-user]').contains(`Active User (${activeUser.user.uuid})`); + }); + + // Fake submitted by another user + cy.intercept({method: 'GET', url: '**/arvados/v1/container_requests/*'}, (req) => { + req.reply((res) => { + res.body.modified_by_user_uuid = 'zzzzz-tpzed-000000000000000'; + }); + }); + + createContainerRequest( + activeUser, + `test_container_request ${Math.floor(Math.random() * 999999)}`, + 'arvados/jobs', + ['echo', 'hello world'], + false, 'Committed') + .then(function(containerRequest) { + cy.loginAs(activeUser); + cy.goToPath(`/processes/${containerRequest.uuid}`); + cy.get('[data-cy=process-details]').should('contain', containerRequest.name); cy.get('[data-cy=process-details-attributes-modifiedby-user]').contains(`zzzzz-tpzed-000000000000000`); + cy.get('[data-cy=process-details-attributes-runtime-user]').contains(`Active User (${activeUser.user.uuid})`); }); }); diff --git a/src/views/process-panel/process-details-attributes.tsx b/src/views/process-panel/process-details-attributes.tsx index d3515fd5..6c20f967 100644 --- a/src/views/process-panel/process-details-attributes.tsx +++ b/src/views/process-panel/process-details-attributes.tsx @@ -100,12 +100,12 @@ export const ProcessDetailsAttributes = withStyles(styles, { withTheme: true })( - {(container && container.modifiedByUserUuid) && + {(containerRequest && containerRequest.modifiedByUserUuid) && } /> } - {(container && container.runtimeUserUuid && container.runtimeUserUuid !== container.modifiedByUserUuid) && + {(container && container.runtimeUserUuid && container.runtimeUserUuid !== containerRequest.modifiedByUserUuid) && } />