Skip to content

Commit

Permalink
test: add basic Home spec
Browse files Browse the repository at this point in the history
  • Loading branch information
yosevu committed Oct 21, 2022
1 parent c97d344 commit 21dd61e
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 102 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,4 @@ dist-ssr
.clj-kondo
.calva
.nrepl-port
cypress/videos
4 changes: 2 additions & 2 deletions cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ import { defineConfig } from "cypress";

export default defineConfig({
e2e: {
baseUrl: 'https://eats.seesparkbox.com/refresh'
baseUrl: 'http://127.0.0.1:5173/sparkeats/',
},
});
});
19 changes: 19 additions & 0 deletions cypress/e2e/Home.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/// <reference types="cypress" />

export {}

const env = {
development: {
url: 'http://127.0.0.1:5173/sparkeats/',
}
};

context('Given a user is on a Home page', () => {
context('When the user accesses the Sparkeats Logo in the Site Header', () => {
specify('Then the link goes to the Home page', () => {
cy.visit('/')
cy.findByRole('link', { name: 'Return to the Sparkeats Home page.'}).click();
cy.url().should('eq', env.development.url);
});
});
});
96 changes: 0 additions & 96 deletions cypress/e2e/basicTests.cy.ts

This file was deleted.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"postinstall": "husky install",
"lint:ts": "eslint src",
"lint:scss": "stylelint src/**/*.scss",
"test": "cypress run"
"test:e2e": "yarn cypress open",
"test:e2e:ci": "yarn cypress run"
},
"dependencies": {
"react": "^18.2.0",
Expand All @@ -31,7 +32,7 @@
"@vitejs/plugin-react": "^2.1.0",
"eslint": "^8.25.0",
"eslint-config-prettier": "^8.5.0",
"cypress": "^10.9.0",
"cypress": "^10.10.0",
"husky": "^8.0.1",
"mysql2": "^2.3.3",
"nbb": "^0.7.135",
Expand Down
2 changes: 1 addition & 1 deletion src/components/SiteHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export const SiteHeader = () => {
return (
<header className="site-header">
<h1 className="site-header__title">Sparkeats by Sparkbox</h1>
<a className="site-header__logo" href="/" aria-label="Return to Sparkeats Homepage" />
<a className="site-header__logo" href="/" aria-label="Return to the Sparkeats Home page." />
</header>
);
};
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1320,7 +1320,7 @@ csstype@^3.0.2:
resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.1.1.tgz#841b532c45c758ee546a11d5bd7b7b473c8c30b9"
integrity sha512-DJR/VvkAvSZW9bTouZue2sSxDwdTN92uHjqeKVm+0dAqdfNykRzQ95tay8aXMBAAPpUiq4Qcug2L7neoRh2Egw==

cypress@^10.9.0:
cypress@^10.10.0:
version "10.10.0"
resolved "https://registry.yarnpkg.com/cypress/-/cypress-10.10.0.tgz#fd671297b2ca3e64dfffd55fe3857c388cfbb695"
integrity sha512-bU8r44x1NIYAUNNXt3CwJpLOVth7HUv2hUhYCxZmgZ1IugowDvuHNpevnoZRQx1KKOEisLvIJW+Xen5Pjn41pg==
Expand Down

0 comments on commit 21dd61e

Please sign in to comment.