Skip to content

Commit

Permalink
test: Update tests to show the logs before trying to view them.
Browse files Browse the repository at this point in the history
Also remove the unnecessary, failing loading spinner test.
  • Loading branch information
mmcknett committed May 18, 2024
1 parent 5d3d186 commit d49b651
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
6 changes: 2 additions & 4 deletions cypress/e2e/happy-path.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ describe('Loggr End-to-end happy path tests', () => {
cy.clearDb();
});

it('Shows a loading spinner', () => {
cy.contains('Loading');
});

it('Creates a new user', () => {
cy.get('.signup-link').click();
cy.get('#email').type('[email protected]');
Expand Down Expand Up @@ -52,12 +48,14 @@ describe('Loggr End-to-end happy path tests', () => {
// FUTURE: This might fail later when the test runs after 8am and we stop allowing end time to be before start time.
cy.get('#endTime').type('08:00');
cy.get('form').submit();
cy.get(`[data-testid=show-all-logs]`).click();
cy.get('.note-display').contains('A permanent note');

cy.wait(500); // Give the firestore library a chance to persist the change
});

it('Can delete the note', () => {
cy.get(`[data-testid=show-all-logs]`).click();
cy.get('.delete-button').click();
cy.get('td').contains('No Data');
});
Expand Down
1 change: 1 addition & 0 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export default function App() {
<LogTable /> :
<a
className='signup-link'
data-testid='show-all-logs'
style={{ marginBlockEnd: '4em' }}
onClick={(e) => { e.preventDefault(); setShowLogTable(true); }}
>Show All Logs</a>
Expand Down

0 comments on commit d49b651

Please sign in to comment.