From d291902ba4bb0c0625bcc8b6bc1bf3ffbd161113 Mon Sep 17 00:00:00 2001 From: catherine meng Date: Wed, 6 Mar 2024 15:20:32 -0800 Subject: [PATCH] fix(1179): fix frontend test, refs: #1179 --- frontend/src/tests/Landing.spec.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/frontend/src/tests/Landing.spec.ts b/frontend/src/tests/Landing.spec.ts index 5a106767a..b62ac7583 100644 --- a/frontend/src/tests/Landing.spec.ts +++ b/frontend/src/tests/Landing.spec.ts @@ -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');