Skip to content

Instantly share code, notes, and snippets.

@ksakae1216
Created December 24, 2022 08:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ksakae1216/c56037355fbbe29d77dceb38cec5af9c to your computer and use it in GitHub Desktop.
Save ksakae1216/c56037355fbbe29d77dceb38cec5af9c to your computer and use it in GitHub Desktop.
describe('LoginFormComponent', () => {
it('should display required error message', () => {
setup();
cy.get('input[name=loginId]').click();
cy.get('[data-cy="password"]').click({force: true});
cy.get('mat-error').should('contain', 'ログインIDを入力してください');
});
});
function setup() {
cy.mount(LoginFormComponent, {
imports: [BrowserAnimationsModule, ReactiveFormsModule, MatButtonModule, MatCardModule, MatFormFieldModule, MatIconModule, MatInputModule],
declarations: [MatError],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment