15685: Fixes unneeded Math.floor() calls on some tests that need random numbers.
authorLucas Di Pentima <lucas@di-pentima.com.ar>
Fri, 6 Nov 2020 15:33:02 +0000 (12:33 -0300)
committerLucas Di Pentima <lucas@di-pentima.com.ar>
Fri, 6 Nov 2020 15:33:02 +0000 (12:33 -0300)
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas@di-pentima.com.ar>

cypress/integration/collection-panel.spec.js
cypress/integration/login.spec.js

index 21b52686f326d664568a3c5d440b1409454b6f16..19a28c88b97e228129f37535d1bb8053c0137e4d 100644 (file)
@@ -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, {
         // 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() {
             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, {
         // 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() {
             owner_uuid: activeUser.user.uuid,
             manifest_text: ". 37b51d194a7513e45b56f6524f2d51f2+3 0:3:bar\n"})
         .as('testCollection').then(function() {
index d88c7a6cfa7252a0825de0ba357a87c418947c14..7a6f71608a4c7486e71f72dc9fc4dd0f034b6af0 100644 (file)
@@ -28,7 +28,7 @@ describe('Login tests', function() {
                 inactiveUser = this.inactiveUser;
             }
         );
                 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',
         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({
         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.
             })
         }, null, activeUser.token, true);
         // Should log the user out.