Skip to content

Commit

Permalink
fix: dsh_sidemenu e2e test not finding admin use cases
Browse files Browse the repository at this point in the history
  • Loading branch information
mbetancurt committed Jun 8, 2020
1 parent b7d2190 commit 2176c60
Show file tree
Hide file tree
Showing 14 changed files with 13 additions and 30 deletions.
26 changes: 7 additions & 19 deletions cypress/integration/dsh_sidemenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,15 @@ describe('SP: Dashboard', function () {
cy.setCookie('jwt', response.body);
});

cy.visit('http://localhost:2000/dashboard/operations');
cy.get('.dshSide > .bp3-menu > li > .bp3-intent-primary > .bp3-text-overflow-ellipsis').click();
cy.visit('http://localhost:2000/dashboard/');
cy.get('.dshSide > .bp3-menu > li:nth-child(3) > .bp3-menu-item > .bp3-text-overflow-ellipsis').click();
cy.get('.dshSide > .bp3-menu > li:nth-child(3) > .bp3-menu-item > .bp3-text-overflow-ellipsis').click();
cy.get('.dshSide > .bp3-menu > li:nth-child(9) > .bp3-menu-item > .bp3-text-overflow-ellipsis').click();
cy.get('.dshSide > .bp3-menu > li:nth-child(10) > .bp3-menu-item > .bp3-text-overflow-ellipsis').click();
cy.get('.dshSide > .bp3-menu > li:nth-child(12) > .bp3-menu-item > .bp3-text-overflow-ellipsis').click();
cy.get('#dshContentCont > .dshUsersListButtons > .bp3-tabs > .bp3-tab-list > #bp3-tab-title_dshUsersListsTabs_1').click();
cy.get('#dshContentCont > .dshUsersListButtons > .bp3-tabs > .bp3-tab-list > #bp3-tab-title_dshUsersListsTabs_0').click();
cy.get('tr:nth-child(1) > td > div > .bp3-button:nth-child(1) > .bp3-button-text').click();
cy.visit('http://localhost:2000/dashboard/users/');
cy.get('tr:nth-child(1) > td > div > .bp3-button:nth-child(2) > .bp3-button-text').click();
cy.get('.dashboard > .dshSide > .bp3-menu > li:nth-child(16) > .bp3-menu-item').click();
cy.get('.dshContent > #dshContentCont > .bp3-callout:nth-child(2) > .bp3-heading > div').click();
cy.get('.dshSide > .bp3-menu > li:nth-child(14) > .bp3-menu-item > .bp3-text-overflow-ellipsis').click();
cy.get('#dshContentCont > div > .dshList > .bp3-callout:nth-child(1) > .bp3-heading').click();
cy.get('div > .dshList > .bp3-callout > .animated > .bp3-button').click();
cy.contains('REALTIME MAP').click();
cy.visit('http://localhost:2000/dashboard/');
cy.get('.dshSide > .bp3-menu > li:nth-child(7) > .bp3-menu-item > .bp3-text-overflow-ellipsis').click();
cy.get('.bp3-overlay > .bp3-dialog-container > .bp3-dialog > .logoutButtons > .bp3-button:nth-child(2)').click({force: true});
cy.contains('Español').click();
cy.contains('English').click();
cy.contains('All users').click();
cy.contains('All operations').click();
cy.contains('All vehicles').click();
cy.contains('Log out').click();
});
it('All buttons of the sidemenu - pilot', function() {
cy
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified cypress/videos/dsh_list_users.js.mp4
Binary file not shown.
Binary file modified cypress/videos/dsh_newvehicle.js.mp4
Binary file not shown.
Binary file modified cypress/videos/dsh_sidemenu.js.mp4
Binary file not shown.
Binary file modified cypress/videos/map_createnewoperation.js.mp4
Binary file not shown.
Binary file modified cypress/videos/map_layers.js.mp4
Binary file not shown.
Binary file modified cypress/videos/map_operations.js.mp4
Binary file not shown.
Binary file modified cypress/videos/map_quickfly.js.mp4
Binary file not shown.
Binary file modified cypress/videos/sp_login.js.mp4
Binary file not shown.
Binary file modified cypress/videos/sp_registration.js.mp4
Binary file not shown.
Binary file added cypress/videos/sp_simulator.js.mp4
Binary file not shown.
12 changes: 4 additions & 8 deletions src/dashboard/user/UsersList.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, {useEffect, useState} from 'react';
import {API, USERS_DATA_TOO_OLD} from '../../consts';
import {fM, fSM, maybeValues} from '../../libs/SaferSanctuary';
import {API} from '../../consts';
import {fM, maybeValues} from '../../libs/SaferSanctuary';
import S from 'sanctuary';
import A from 'axios';
import '../../Ades.css';
Expand Down Expand Up @@ -33,10 +33,6 @@ function useUsersState() {
const refetch = () => setRefechtime(Date.now());
const usersListExtracted = maybeValues(usersList);

useEffect(() => {
console.log('Refetch', refetchTime);
}, [refetchTime]);

useEffect(() => {
Axios.get(API + 'user', {headers: {auth: fM(state.auth.token)}})
.then(result => {
Expand All @@ -53,7 +49,7 @@ function useUsersState() {
print(state, true, '*UserState', error);
setIsError(true);
});
}, [refetchTime]); // Fetch users for the first time if empty
}, [refetchTime]); // eslint-disable-line react-hooks/exhaustive-deps

return [usersListExtracted, usersUpdated, isEmpty, isError, refetch];
}
Expand Down Expand Up @@ -86,7 +82,7 @@ const UsersList = () => {
const selected = users.find(user => user.username === username);
setShownPilot(S.Just(selected));
}
}, [username, usersUpdated]);
}, [username, usersUpdated, isEmpty]); // eslint-disable-line react-hooks/exhaustive-deps

return (
<>
Expand Down
5 changes: 2 additions & 3 deletions src/state/VerificationScreen.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React, {useEffect, useState} from 'react';
import {Button, Card, Elevation, FormGroup, InputGroup, Intent, Spinner} from '@blueprintjs/core';
import S from 'sanctuary';
import {Button, Card, Elevation, Intent, Spinner} from '@blueprintjs/core';
import {useTranslation} from 'react-i18next';
import { useParams, useHistory } from 'react-router-dom';
import A from 'axios';
Expand Down Expand Up @@ -49,7 +48,7 @@ function VerificationScreen() {
setLoading(false);
setError(true);
});
}, []);
}, [username, token]);

return (
<div className="centeredScreen texturedBackground">
Expand Down

0 comments on commit 2176c60

Please sign in to comment.