Skip to content

Commit

Permalink
test(): fixed test and added another one related with plugin config
Browse files Browse the repository at this point in the history
  • Loading branch information
JoseGoncalves committed Jan 5, 2023
1 parent 36528c1 commit 01ef077
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/plugin.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,19 @@ describe('vueKeycloak', () => {
;(initKeycloak as jest.Mock).mockImplementation(() => undefined)
})

test('should throw an error if config is nil', async () => {
test('should throw an error if plugin config is nil', async () => {
try {
await vueKeycloak.install(appMock)
} catch (error) {
expect(error.message).toBe('The Keycloak.KeycloakConfig are requried')
expect(error.message).toBe('The VueKeycloakPluginConfig is required')
}
})

test('should throw an error if keycloak config is nil', async () => {
try {
await vueKeycloak.install(appMock, {})
} catch (error) {
expect(error.message).toBe('The Keycloak.KeycloakConfig is required')
}
})

Expand Down

0 comments on commit 01ef077

Please sign in to comment.