Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(lists): Cache lists #59

Merged
merged 15 commits into from
May 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .github/workflows/cypress-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Cypress Tests
push:
paths-ignore:
- '**/*.md'
- '.github/workflows/*.yml'
# - '.github/workflows/*.yml'

jobs:
cypress-run:
Expand All @@ -17,9 +17,13 @@ jobs:
# and run all Cypress tests
- name: Cypress run
uses: cypress-io/[email protected] # use the explicit version number
env:
DEBUG: '@cypress/github-action' # Turn on debug logs for troubleshooting
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
with:
# Wait for the emulator UI to be available (indicates emulators fully loaded)
# and for the page to be available on the hosting emulator.
wait-on: 'http://localhost:4000, http://localhost:5000'
build: 'npm run build:tests'
start: npm run emulators:tests
start: npm run emulators:tests
record: true
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,6 @@ serviceAccount.json

# Firestore emulator directories
fs-dev-stash

# Cypress videos
*.mp4
3 changes: 2 additions & 1 deletion cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ export default defineConfig({
// implement node event listeners here
},
},
video: false
video: true,
projectId: "9pvri1",
});
8 changes: 3 additions & 5 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 All @@ -39,7 +35,7 @@ describe('Loggr End-to-end happy path tests', () => {
it('Can create a draft that persists', () => {
cy.get('#note').type('A draft note');

cy.wait(1100); // Draft takes a second to save
cy.wait(1500); // Draft takes a second to save

cy.visit(INDEX);
cy.get('#note').should('have.value', 'A draft note'); // .contains isn't working for a textarea; .should('have.value', ...) does, though.
Expand All @@ -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
Loading
Loading