-
-
Notifications
You must be signed in to change notification settings - Fork 3k
/
providers.spec.js
46 lines (40 loc) · 1.51 KB
/
providers.spec.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/// <reference types="Cypress" />
// This needs to be refactored as the links are now buttons as CSRF token
// checking is done before starting an OAuth journey.
describe.skip("Users can sign in with various providers", async () => {
beforeEach(() => {
cy.visit("/");
cy.findByRole("link", { name: "Sign in" }).click();
cy.location().should((loc) => {
expect(loc.pathname).to.eq("/api/auth/signin");
});
});
it("Signing in with Google", () => {
cy.findByRole("link", { name: "Sign in with Google" }).click();
cy.location().should((loc) => {
expect(loc.hostname).to.eq("https://accounts.google.com");
expect(loc.pathname).to.eq("/signin/oauth/oauthchooseaccount");
});
});
it("Signing in with Facebook", () => {
cy.findByRole("link", { name: "Sign in with Facebook" }).click();
cy.location().should((loc) => {
expect(loc.hostname).to.eq("www.facebook.com");
expect(loc.pathname).to.eq("/v7.0/dialog/oauth");
});
});
it("Signing in with Twitter", () => {
cy.findByRole("link", { name: "Sign in with Twitter" }).click();
cy.location().should((loc) => {
expect(loc.hostname).to.eq("api.twitter.com");
expect(loc.pathname).to.eq("/oauth/authenticate");
});
});
it("Signing in with GitHub", () => {
cy.findByRole("link", { name: "Sign in with GitHub" }).click();
cy.location().should((loc) => {
expect(loc.hostname).to.eq("github.com");
expect(loc.pathname).to.eq("/login/oauth/authorize");
});
});
});