diff --git a/app/styles/plus.css b/app/styles/plus.css index a68b4060c..7cd209699 100644 --- a/app/styles/plus.css +++ b/app/styles/plus.css @@ -1,4 +1,4 @@ .plus__suggested-info-text { - font-size: var(--fonts-lg); color: var(--text-lighter); + font-size: var(--fonts-lg); } diff --git a/cypress/integration/plus.spec.ts b/cypress/integration/plus.spec.ts new file mode 100644 index 000000000..2fe9c9a36 --- /dev/null +++ b/cypress/integration/plus.spec.ts @@ -0,0 +1,13 @@ +export {}; + +describe("Plus suggestions page", () => { + beforeEach(() => { + cy.seed(); + }); + + it("views suggestions status as non plus member", function () { + cy.auth(150); + cy.visit("/plus"); + cy.contains("You are suggested"); + }); +}); diff --git a/cypress/integration/user-page.spec.ts b/cypress/integration/user.spec.ts similarity index 96% rename from cypress/integration/user-page.spec.ts rename to cypress/integration/user.spec.ts index 8b88e0448..5507eab7f 100644 --- a/cypress/integration/user-page.spec.ts +++ b/cypress/integration/user.spec.ts @@ -44,6 +44,6 @@ describe("User page", () => { cy.getCy("profile-page-link").click(); cy.contains("Sendou"); cy.contains("Finland").should("not.exist"); - cy.contains(bio); + cy.contains(bio).should("not.exist"); }); }); diff --git a/cypress/support/index.ts b/cypress/support/index.ts index 7f73de7da..a9b1a4465 100644 --- a/cypress/support/index.ts +++ b/cypress/support/index.ts @@ -6,7 +6,7 @@ declare global { interface Chainable { getCy(id: string): Chainable>; seed(): void; - auth(): void; + auth(userId?: number): void; } } } @@ -15,13 +15,11 @@ Cypress.Commands.add("getCy", (id) => { return cy.get(`[data-cy=${id}]`); }); +// TODO: make this a request instead... probably faster? Cypress.Commands.add("seed", () => { cy.exec("npm run seed"); }); -const SENDOU_COOKIE = - "eyJvYXV0aDI6c3RhdGUiOiJhMDE0MjI5Mi03YjRiLTRkYTYtYWQxZC1jMTI5ZWExZGVhNjUiLCJ1c2VyIjp7ImlkIjoxLCJkaXNjb3JkSWQiOiI3OTIzNzQwMzYyMDk0NTkyMCIsImRpc2NvcmRBdmF0YXIiOiJmY2ZkNjVhM2JlYTU5ODkwNWFiYjljYTI1Mjk2ODE2YiJ9LCJzdHJhdGVneSI6ImRpc2NvcmQifQ%3D%3D.yf5YER%2B15VPqVk6Kys2jnpPAQqbq2Yv%2FF50lmGAIilc"; - -Cypress.Commands.add("auth", () => { - cy.setCookie("_session", SENDOU_COOKIE); +Cypress.Commands.add("auth", (id = 1) => { + cy.request("POST", `/auth/impersonate?id=${id}`); });