Skip to content

Commit

Permalink
fix(1179): fix frontend test, refs: #1179
Browse files Browse the repository at this point in the history
  • Loading branch information
MCatherine1994 committed Mar 6, 2024
1 parent 61f6374 commit d291902
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions frontend/src/tests/Landing.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,19 @@ describe('Landing', () => {
await button.trigger('click');
expect(loginSpy).toHaveBeenCalled();
});
it('should render BCeID button and be disabled', async () => {
it('should render BCeID button and be enabled', async () => {
const button = wrapper.get('#login-bceid-button');
expect(button.classes()).toEqual(
expect.arrayContaining(['landing-button'])
);
expect(button.html().includes('Login with BCeID')).toBe(true);
expect(button.attributes()).toHaveProperty('disabled');
expect(button.attributes()).not.toHaveProperty('disabled');
});
it('should button Login with BCEID be clicked', async () => {
const button = wrapper.get('#login-bceid-button');
const loginSpy = vi.spyOn(AuthService, 'loginBceid');
await button.trigger('click');
expect(loginSpy).toHaveBeenCalled();
});
it('should render image', () => {
const img = wrapper.findAll('.landing-img');
Expand Down

0 comments on commit d291902

Please sign in to comment.