generated from sergiodxa/remix-auth-strategy-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.
- Loading branch information
1 parent
de7d312
commit aea6020
Showing
19 changed files
with
182 additions
and
782 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 was deleted.
Oops, something went wrong.
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,24 @@ | ||
import { defineConfig } from "cypress"; | ||
|
||
export default defineConfig({ | ||
e2e: { | ||
setupNodeEvents: (on, config) => { | ||
const configOverrides: Partial<Cypress.PluginConfigOptions> = { | ||
baseUrl: `http://localhost:3000`, | ||
screenshotOnRunFailure: !process.env.CI, | ||
}; | ||
|
||
// To use this: | ||
// cy.task('log', whateverYouWantInTheTerminal) | ||
on("task", { | ||
log: (message) => { | ||
console.log(message); | ||
|
||
return null; | ||
}, | ||
}); | ||
|
||
return { ...config, ...configOverrides }; | ||
}, | ||
}, | ||
}); |
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,6 @@ | ||
module.exports = { | ||
parserOptions: { | ||
tsconfigRootDir: __dirname, | ||
project: "./tsconfig.json", | ||
}, | ||
}; |
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,44 @@ | ||
describe("PreviewBrowser", () => { | ||
it("should open to no preview selected", () => { | ||
cy.visit("/email"); | ||
cy.findByText("No preview selected."); | ||
}); | ||
|
||
it("should open preview", () => { | ||
cy.visit("/email"); | ||
cy.get('[aria-label="view loginCode"]').click(); | ||
cy.location().should((loc) => { | ||
expect(loc.search).to.eq("?preview=loginCode"); | ||
}); | ||
|
||
cy.get('[aria-label="view resetPassword"]').click(); | ||
cy.location().should((loc) => { | ||
expect(loc.search).to.eq("?preview=resetPassword"); | ||
}); | ||
}); | ||
|
||
it("should switch between mobile and desktop view", () => { | ||
cy.visit("/email?preview=loginCode"); | ||
cy.get('[aria-label="view mobile resolution"]').click(); | ||
cy.location().should((loc) => { | ||
expect(loc.search).to.eq("?preview=loginCode&view=mobile"); | ||
}); | ||
cy.findByTitle("loginCode preview") | ||
.should("have.class", "max-w-[375px]") | ||
.should("have.class", "max-h-[667px]"); | ||
cy.get('[aria-label="view desktop resolution"]').click(); | ||
cy.location().should((loc) => { | ||
expect(loc.search).to.eq("?preview=loginCode&view=desktop"); | ||
}); | ||
cy.findByTitle("loginCode preview") | ||
.should("not.have.class", "max-w-[375px]") | ||
.should("not.have.class", "max-h-[667px]"); | ||
}); | ||
|
||
it("should show a hamburger menu on small resolutions", () => { | ||
cy.visit("/email"); | ||
cy.get('[aria-label="open side navigation"]').should("not.be.visible"); | ||
cy.viewport("iphone-se2"); | ||
cy.get('[aria-label="open side navigation"]').should("be.visible"); | ||
}); | ||
}); |
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,14 @@ | ||
import "@testing-library/cypress/add-commands"; | ||
|
||
Cypress.on("uncaught:exception", (err) => { | ||
// Cypress and React Hydrating the document don't get along | ||
// for some unknown reason. Hopefully we figure out why eventually | ||
// so we can remove this. | ||
if ( | ||
/hydrat/i.test(err.message) || | ||
/Minified React error #418/.test(err.message) || | ||
/Minified React error #423/.test(err.message) | ||
) { | ||
return false; | ||
} | ||
}); |
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,28 @@ | ||
{ | ||
"exclude": [ | ||
"../node_modules/@types/jest", | ||
"../node_modules/@testing-library/jest-dom" | ||
], | ||
"include": [ | ||
"e2e/**/*", | ||
"support/**/*", | ||
"../node_modules/cypress", | ||
"../node_modules/@testing-library/cypress" | ||
], | ||
"compilerOptions": { | ||
"baseUrl": ".", | ||
"noEmit": true, | ||
"types": ["node", "cypress", "@testing-library/cypress"], | ||
"esModuleInterop": true, | ||
"jsx": "react-jsx", | ||
"moduleResolution": "Bundler", | ||
"target": "ES2020", | ||
"strict": true, | ||
"skipLibCheck": true, | ||
"resolveJsonModule": true, | ||
|
||
"paths": { | ||
"~/*": ["../app/*"] | ||
} | ||
} | ||
} |
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.