Skip to content

Commit

Permalink
test(e2e): sign in as admin
Browse files Browse the repository at this point in the history
  • Loading branch information
awinogradov committed Aug 9, 2023
1 parent b3475f2 commit 16525e8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
16 changes: 16 additions & 0 deletions cypress/e2e/dashboard.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
const exactUrl = (route: string) => `${Cypress.config('baseUrl')}${route}`;

describe('Dashboard', () => {
it('asks to sign in on fist visit', () => {
cy.visit('/');

cy.url().should('equal', exactUrl('/api/auth/signin'));

cy.get('input[name=email]').type(Cypress.env('ADMIN_EMAIL'));

// {enter} causes the form to submit
cy.get('input[name=password]').type(`${Cypress.env('ADMIN_PASSWORD')}{enter}`);

cy.url().should('equal', exactUrl('/'));
});
});
5 changes: 0 additions & 5 deletions cypress/e2e/home_page.cy.ts

This file was deleted.

0 comments on commit 16525e8

Please sign in to comment.