From: Lucas Di Pentima Date: Fri, 6 Nov 2020 15:33:02 +0000 (-0300) Subject: 15685: Fixes unneeded Math.floor() calls on some tests that need random numbers. X-Git-Tag: 2.1.1~1^2~12 X-Git-Url: https://git.arvados.org/arvados-workbench2.git/commitdiff_plain/04721847d0d2d5607999df598aed355d3ae6c6bc?hp=3af60f74e1bb43c779d660bda187d780b677188e 15685: Fixes unneeded Math.floor() calls on some tests that need random numbers. Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima --- diff --git a/cypress/integration/collection-panel.spec.js b/cypress/integration/collection-panel.spec.js index 21b52686..19a28c88 100644 --- a/cypress/integration/collection-panel.spec.js +++ b/cypress/integration/collection-panel.spec.js @@ -122,7 +122,7 @@ describe('Collection panel tests', function() { // Creates the collection using the admin token so we can set up // a bogus manifest text without block signatures. cy.createCollection(adminUser.token, { - name: `Test collection ${Math.floor(Math.random() * Math.floor(999999))}`, + name: `Test collection ${Math.floor(Math.random() * 999999)}`, owner_uuid: activeUser.user.uuid, manifest_text: ". 37b51d194a7513e45b56f6524f2d51f2+3 0:3:bar\n"}) .as('testCollection').then(function() { @@ -149,7 +149,7 @@ describe('Collection panel tests', function() { // Creates the collection using the admin token so we can set up // a bogus manifest text without block signatures. cy.createCollection(adminUser.token, { - name: `Test collection ${Math.floor(Math.random() * Math.floor(999999))}`, + name: `Test collection ${Math.floor(Math.random() * 999999)}`, owner_uuid: activeUser.user.uuid, manifest_text: ". 37b51d194a7513e45b56f6524f2d51f2+3 0:3:bar\n"}) .as('testCollection').then(function() { diff --git a/cypress/integration/login.spec.js b/cypress/integration/login.spec.js index d88c7a6c..7a6f7160 100644 --- a/cypress/integration/login.spec.js +++ b/cypress/integration/login.spec.js @@ -28,7 +28,7 @@ describe('Login tests', function() { inactiveUser = this.inactiveUser; } ); - randomUser.username = `randomuser${Math.floor(Math.random() * Math.floor(999999))}`; + randomUser.username = `randomuser${Math.floor(Math.random() * 999999)}`; randomUser.password = { crypt: 'zpAReoZzPnwmQ', clear: 'topsecret', @@ -89,7 +89,7 @@ describe('Login tests', function() { cy.doRequest('PUT', `/arvados/v1/api_client_authorizations/${tokenUuid}`, { id: tokenUuid, api_client_authorization: JSON.stringify({ - api_token: `randomToken${Math.floor(Math.random() * Math.floor(999999))}` + api_token: `randomToken${Math.floor(Math.random() * 999999)}` }) }, null, activeUser.token, true); // Should log the user out.