From d49b651a4b86c4280c97586402f68bacb2d1f3d6 Mon Sep 17 00:00:00 2001 From: Matt McKnett Date: Sat, 18 May 2024 14:28:27 -0700 Subject: [PATCH] test: Update tests to show the logs before trying to view them. Also remove the unnecessary, failing loading spinner test. --- cypress/e2e/happy-path.cy.ts | 6 ++---- src/App.tsx | 1 + 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/cypress/e2e/happy-path.cy.ts b/cypress/e2e/happy-path.cy.ts index 598504b..a051120 100644 --- a/cypress/e2e/happy-path.cy.ts +++ b/cypress/e2e/happy-path.cy.ts @@ -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('test@example.com'); @@ -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'); }); diff --git a/src/App.tsx b/src/App.tsx index 152b1bb..6adc8b2 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -41,6 +41,7 @@ export default function App() { : { e.preventDefault(); setShowLogTable(true); }} >Show All Logs