forked from Universal-Connect-Project/ucw-adapter-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/main' into tysn/sync-upstream
- Loading branch information
Showing
49 changed files
with
7,993 additions
and
354 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { defineConfig } from "cypress"; | ||
|
||
import baseCypressConfig from "./baseCypressConfig"; | ||
|
||
export default defineConfig({ | ||
...baseCypressConfig, | ||
e2e: { | ||
...baseCypressConfig.e2e, | ||
specPattern: "cypress/e2e/authenticationSuite/**/*.{js,jsx,ts,tsx}", | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"auth_audience": "ucp-hosted-apps", | ||
"auth_scope": "widget:demo", | ||
"auth_client_id": "osS8CuafkPsJlfz5mfKRgYH942Pmwpxd", | ||
"auth_domain": "dev-d23wau8o0uc5hw8n.us.auth0.com", | ||
"auth_username": "testname", | ||
"auth_password": "testpassword" | ||
} |
43 changes: 43 additions & 0 deletions
43
apps/server/cypress/e2e/authenticationSuite/authentication.cy.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import { | ||
clickContinue, | ||
expectConnectionSuccess, | ||
visitAgg, | ||
} from "@repo/utils-dev-dependency"; | ||
import { | ||
enterTestExampleACredentials, | ||
searchAndSelectTestExampleA, | ||
} from "../../shared/utils/testExample"; | ||
|
||
describe("authentication", () => { | ||
it("fails if not authorized", () => { | ||
visitAgg({ failOnStatusCode: false }); | ||
|
||
cy.findByText("Unauthorized").should("exist"); | ||
}); | ||
|
||
it("is able to connect with the token flow", () => { | ||
const accessToken = Cypress.env("accessToken"); | ||
|
||
const userId = crypto.randomUUID(); | ||
|
||
cy.request({ | ||
headers: { | ||
authorization: `Bearer ${accessToken}`, | ||
}, | ||
method: "GET", | ||
url: `/api/token?userId=${userId}`, | ||
}).then((response) => { | ||
const token = response.body.token; | ||
|
||
visitAgg({ | ||
userId, | ||
token, | ||
}); | ||
|
||
searchAndSelectTestExampleA(); | ||
enterTestExampleACredentials(); | ||
clickContinue(); | ||
expectConnectionSuccess(); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.