From 04721847d0d2d5607999df598aed355d3ae6c6bc Mon Sep 17 00:00:00 2001 From: Lucas Di Pentima Date: Fri, 6 Nov 2020 12:33:02 -0300 Subject: [PATCH] 15685: Fixes unneeded Math.floor() calls on some tests that need random numbers. Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima --- cypress/integration/collection-panel.spec.js | 4 ++-- cypress/integration/login.spec.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) 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. -- 2.30.2