Skip to content

Commit

Permalink
Merge pull request #25 from pavlovcik/fix/cypress-test
Browse files Browse the repository at this point in the history
Fix/cypress test
  • Loading branch information
0x4007 authored Mar 8, 2024
2 parents 04e1f25 + ca3dcb8 commit eb65591
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 13 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/cypress-testing.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
name: Run Cypress testing suite
on:
workflow_dispatch:
push:
branches:
- development
pull_request:
types: [ opened, synchronize ]

jobs:
cypress-run:
Expand Down
18 changes: 9 additions & 9 deletions cypress/e2e/devpool.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,15 @@ describe("DevPool", () => {
cy.fixture("user-github.json").then((content) => {
githubUser = content;
});
cy.intercept("https://api.github.com/repos/*/*/issues/**", (req) => {
});

beforeEach(() => {
// Very important to make sure we don't store data between tests
cy.clearLocalStorage();
cy.intercept("https://api.github.com/repos/**/**/issues/**", (req) => {
req.reply({
statusCode: 200,
body: issue1,
body: [issue1, issue2].find((o) => o.body?.split("/").at(-1) === req.url.split("/").at(-1)),
});
}).as("getIssueDetails");
cy.intercept("https://api.github.com/orgs/*", (req) => {
Expand All @@ -34,12 +39,7 @@ describe("DevPool", () => {
}).as("orgs");
});

beforeEach(() => {
// Very important to make sure we don't store data between tests
cy.clearLocalStorage();
});

it.only("Main page displays issues", () => {
it("Main page displays issues", () => {
// Should display one new task
cy.log("Should display one new task");
cy.intercept("https://api.github.com/repos/*/*/issues**", (req) => {
Expand Down Expand Up @@ -132,7 +132,7 @@ describe("DevPool", () => {
body: githubUser,
});
}).as("getUser");
cy.intercept("https://iyybhhiflwbsjopsgaow.supabase.co/auth/v1/authorize?provider=github", (req) => {
cy.intercept("https://github.com/login/oauth/authorize**", (req) => {
req.reply({
statusCode: 200,
});
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
// "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */
// "types": [], /* Specify type package names to be included without being referenced in a source file. */
"types": ["cypress"] /* Specify type package names to be included without being referenced in a source file. */,
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
// "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */
// "allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */
Expand Down

0 comments on commit eb65591

Please sign in to comment.