1
0
mirror of https://github.com/sasjs/adapter.git synced 2025-12-11 01:14:36 +00:00

chore: fixed test err handling

This commit is contained in:
2022-05-16 15:42:12 +02:00
parent 1ac88ae102
commit 843cee4dbe
3 changed files with 8 additions and 8 deletions

View File

@@ -2604,7 +2604,7 @@
"node_modules/@sasjs/adapter": {
"version": "5.0.0",
"resolved": "file:../build/sasjs-adapter-5.0.0.tgz",
"integrity": "sha512-ARa1FFOHFdiVI/oHngmd5AJv6OZxeCwcHkpYEdrpY5syCg3hvTBYvmUZmxN4cRzwSsxAdiO9NGrHMgHbn5fV0Q==",
"integrity": "sha512-mgXmDKqaKLieVaoICBCLwpI8pj4vff6yqOYySe+dX8+YD90yj2UM1AwDfxGakr9NcE2ptIgwYYAi823s4wNAxQ==",
"hasInstallScript": true,
"license": "ISC",
"dependencies": {
@@ -23331,7 +23331,7 @@
},
"@sasjs/adapter": {
"version": "file:../build/sasjs-adapter-5.0.0.tgz",
"integrity": "sha512-ARa1FFOHFdiVI/oHngmd5AJv6OZxeCwcHkpYEdrpY5syCg3hvTBYvmUZmxN4cRzwSsxAdiO9NGrHMgHbn5fV0Q==",
"integrity": "sha512-mgXmDKqaKLieVaoICBCLwpI8pj4vff6yqOYySe+dX8+YD90yj2UM1AwDfxGakr9NcE2ptIgwYYAi823s4wNAxQ==",
"requires": {
"@sasjs/utils": "2.44.0",
"axios": "0.26.0",

View File

@@ -11,7 +11,7 @@ const Login = (): ReactElement<{}> => {
const handleSubmit = useCallback(
(e) => {
e.preventDefault()
appContext.adapter.logIn(username, password, 'clientID1').then((res) => {
appContext.adapter.logIn(username, password).then((res) => {
appContext.setIsLoggedIn(res.isLoggedIn)
})
},

View File

@@ -37,7 +37,7 @@ export const basicTests = (
title: 'Log in',
description: 'Should log the user in',
test: async () => {
return adapter.logIn(userName, password, 'clientID1')
return adapter.logIn(userName, password)
},
assertion: (response: any) =>
response && response.isLoggedIn && response.userName === userName
@@ -46,7 +46,7 @@ export const basicTests = (
title: 'Fetch username for already logged in user',
description: 'Should log the user in',
test: async () => {
await adapter.logIn(userName, password, 'clientID1')
await adapter.logIn(userName, password)
const newAdapterIns = new SASjs(adapter.getSasjsConfig())
@@ -61,8 +61,8 @@ export const basicTests = (
'Should fail on first attempt and should log the user in on second attempt',
test: async () => {
await adapter.logOut()
await adapter.logIn('invalid', 'invalid', 'clientID1')
return await adapter.logIn(userName, password, 'clientID1')
await adapter.logIn('invalid', 'invalid').catch((err: any) => {})
return await adapter.logIn(userName, password)
},
assertion: (response: any) =>
response && response.isLoggedIn && response.userName === userName
@@ -79,7 +79,7 @@ export const basicTests = (
stringData,
undefined,
async () => {
await adapter.logIn(userName, password, 'clientID1')
await adapter.logIn(userName, password)
}
)
},