mirror of
https://github.com/fergalmoran/supanextail.git
synced 2026-01-06 16:45:07 +00:00
Clean test and add comments
This commit is contained in:
@@ -40,15 +40,11 @@ const Nav = (props) => {
|
|||||||
)}
|
)}
|
||||||
|
|
||||||
<Link href='/pricing'>
|
<Link href='/pricing'>
|
||||||
<a className='nav-btn' id='pricingLink'>
|
<a className='nav-btn'>Pricing</a>
|
||||||
Pricing
|
|
||||||
</a>
|
|
||||||
</Link>
|
</Link>
|
||||||
|
|
||||||
<Link href='/contact'>
|
<Link href='/contact'>
|
||||||
<a className='nav-btn' id='contactLink'>
|
<a className='nav-btn'>Contact Us</a>
|
||||||
Contact Us
|
|
||||||
</a>
|
|
||||||
</Link>
|
</Link>
|
||||||
|
|
||||||
{props.user ? (
|
{props.user ? (
|
||||||
@@ -78,7 +74,7 @@ const Nav = (props) => {
|
|||||||
<div className='hidden lg:flex text-center ml-auto'>{NavMenu}</div>
|
<div className='hidden lg:flex text-center ml-auto'>{NavMenu}</div>
|
||||||
</div>
|
</div>
|
||||||
<div className='flex-none'>
|
<div className='flex-none'>
|
||||||
<div className='dropdown dropdown-end' data-cy="dropdown">
|
<div className='dropdown dropdown-end' data-cy='dropdown'>
|
||||||
<div tabIndex='0' className='m-1 cursor-pointer lg:hidden'>
|
<div tabIndex='0' className='m-1 cursor-pointer lg:hidden'>
|
||||||
<Menu />
|
<Menu />
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,9 +1,12 @@
|
|||||||
|
/*
|
||||||
|
This is a basic test to show you how cypress works (and how easy it is to build tests!)
|
||||||
|
It will launch the homepage and navigate through 2 differents pages (Pricing and Contact).
|
||||||
|
You can see that it will do this twice, with 2 different resolution, to test the mobile version of the site.
|
||||||
|
*/
|
||||||
|
|
||||||
describe("Basic Test", () => {
|
describe("Basic Test", () => {
|
||||||
context("Desktop resolution", () => {
|
context("Desktop resolution", () => {
|
||||||
// run these tests as if in a desktop
|
it("Visits the homepage and nav links (Desktop)", () => {
|
||||||
// browser with a 720p monitor
|
|
||||||
|
|
||||||
it("Visits the homepage and nav links", () => {
|
|
||||||
cy.viewport(1280, 720);
|
cy.viewport(1280, 720);
|
||||||
cy.visit("");
|
cy.visit("");
|
||||||
|
|
||||||
@@ -16,15 +19,14 @@ describe("Basic Test", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
context("Mobile resolution", () => {
|
context("Mobile resolution", () => {
|
||||||
// run these tests as if in a desktop
|
it("Visits the homepage and nav links (Mobile)", () => {
|
||||||
// browser with a 720p monitor
|
|
||||||
|
|
||||||
it("Visits the homepage and nav links", () => {
|
|
||||||
cy.viewport(680, 720);
|
cy.viewport(680, 720);
|
||||||
cy.visit("");
|
cy.visit("");
|
||||||
|
|
||||||
cy.get("[data-cy=dropdown]").click();
|
cy.get("[data-cy=dropdown]").click();
|
||||||
cy.get("[data-cy=dropdown]").contains("Pricing").click();
|
cy.get("[data-cy=dropdown]").contains("Pricing").click();
|
||||||
cy.url().should("include", "/pricing");
|
cy.url().should("include", "/pricing");
|
||||||
|
|
||||||
cy.get("[data-cy=dropdown]").click();
|
cy.get("[data-cy=dropdown]").click();
|
||||||
cy.get("[data-cy=dropdown]").contains("Contact").click();
|
cy.get("[data-cy=dropdown]").contains("Contact").click();
|
||||||
cy.url().should("include", "/contact");
|
cy.url().should("include", "/contact");
|
||||||
|
|||||||
Reference in New Issue
Block a user