Skip to content

Commit

Permalink
Merge branch '10007-story' of https://github.com/flexion/ef-cms into …
Browse files Browse the repository at this point in the history
…10007-story-dod
  • Loading branch information
rachelschneiderman committed Feb 20, 2024
2 parents 55d483f + c870ab3 commit 5cb7154
Show file tree
Hide file tree
Showing 42 changed files with 2,769 additions and 2,995 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: 2.1
orbs:
git-shallow-clone: guitarrapc/[email protected]

efcms-docker-image: &efcms-docker-image $AWS_ACCOUNT_ID.dkr.ecr.us-east-1.amazonaws.com/ef-cms-us-east-1:3.1.2
efcms-docker-image: &efcms-docker-image $AWS_ACCOUNT_ID.dkr.ecr.us-east-1.amazonaws.com/ef-cms-us-east-1:3.1.3

parameters:
run_build_and_deploy:
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ RUN apt-get install -y build-essential
RUN apt-get install -y libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev

ENV JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64
RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64-2.15.18.zip" -o "awscliv2.zip" && \
RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64-2.15.19.zip" -o "awscliv2.zip" && \
unzip awscliv2.zip && \
./aws/install && \
rm -rf awscliv2.zip
Expand Down
81 changes: 81 additions & 0 deletions cypress/cypress-readonly/integration/login.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
import { cypressEnv } from '../../helpers/env/cypressEnvironment';

describe('Given a user with a DAWSON account', () => {
beforeEach(() => {
Cypress.session.clearCurrentSessionData();
});

describe('When they login in with the correct email and password', () => {
it('Then they should be taken to their dashboard', () => {
cy.visit('/login');
// Login Button is Disabled till Enter Both Email and Password
cy.get('[data-testid="login-button"]').should('be.disabled');
cy.get('[data-testid="email-input"]').type(
'[email protected]',
);
cy.get('[data-testid="password-input"]').type(
cypressEnv.defaultAccountPass,
{
log: false,
},
);
cy.get('[data-testid="login-button"]').click();
cy.get('[data-testid="account-menu-button"]');
cy.get('[data-testid="error-alert"]').should('not.exist');

// after reloading they are still logged in
cy.reload();
cy.get('[data-testid="account-menu-button"]');
cy.get('[data-testid="error-alert"]').should('not.exist');
cy.url().should('contain', '/messages');

// manually access url (still logged in)
cy.visit('/trial-sessions');
cy.get('[data-testid="header-text"]').should('contain', 'Trial Sessions');
cy.url().should('contain', '/trial-sessions');
});
});

describe('When they login with a correct email and an misspelled password', () => {
it('Then they should be alerted that their username or password is incorrect', () => {
cy.visit('/login');
cy.get('[data-testid="email-input"]').type(
'[email protected]',
);
cy.get('[data-testid="password-input"]').type('testing1234$', {
log: false,
});
cy.get('[data-testid="login-button"]').click();

cy.get('[data-testid="error-alert"]').should(
'contain',
'The email address or password you entered is invalid',
);
});
});
});

describe('Given a user without a DAWSON account', () => {
beforeEach(() => {
Cypress.session.clearCurrentSessionData();
});

describe('When they login', () => {
it('Then they should be alerted that their username or password is incorrect', () => {
cy.visit('/login');
cy.get('[data-testid="email-input"]').type('[email protected]');
cy.get('[data-testid="password-input"]').type(
cypressEnv.defaultAccountPass,
{
log: false,
},
);
cy.get('[data-testid="login-button"]').click();

cy.get('[data-testid="error-alert"]').should(
'contain',
'The email address or password you entered is invalid',
);
});
});
});
Loading

0 comments on commit 5cb7154

Please sign in to comment.