Skip to content
This repository was archived by the owner on Dec 26, 2023. It is now read-only.

Commit cad44bd

Browse files
committed
update and migrate cypress. add homepage smoke tests
1 parent 49b472f commit cad44bd

File tree

9 files changed

+408
-48
lines changed

9 files changed

+408
-48
lines changed

packages/frontend/.nvmrc

Lines changed: 0 additions & 1 deletion
This file was deleted.

packages/frontend/cypress.config.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { defineConfig } from 'cypress';
2+
3+
export default defineConfig({
4+
e2e: {
5+
// We've imported your old cypress plugins here.
6+
// You may want to clean this up later by importing these.
7+
setupNodeEvents(on, config) {
8+
return require('./cypress/plugins/index.js')(on, config);
9+
},
10+
baseUrl: 'http://localhost:3000/',
11+
video: false,
12+
},
13+
});

packages/frontend/cypress.json

Lines changed: 0 additions & 3 deletions
This file was deleted.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
describe('Homepage Test', () => {
2+
it('Check for Image', () => {
3+
cy.visit('/');
4+
5+
cy.get('[alt="main"]').should('be.visible');
6+
});
7+
8+
it('Check For Heading', () => {
9+
cy.get('h2').should('include.text', 'Build web3 with friends');
10+
});
11+
});
12+
export {};

packages/frontend/cypress/integration/nft-search.spec.js

Lines changed: 0 additions & 28 deletions
This file was deleted.

packages/frontend/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@
3636
"fmt": "prettier --write **/*.js",
3737
"contributors:add": "all-contributors add",
3838
"contributors:generate": "all-contributors generate",
39-
"type-check": "tsc --noEmit"
39+
"type-check": "tsc --noEmit",
40+
"test": "cypress run"
4041
},
4142
"eslintConfig": {
4243
"extends": [
@@ -60,6 +61,7 @@
6061
"@testing-library/cypress": "^8.0.1",
6162
"@testing-library/react-hooks": "^7.0.2",
6263
"all-contributors-cli": "^6.20.0",
64+
"cypress": "^10.4.0",
6365
"eslint": "^8.21.0",
6466
"eslint-config-next": "11.1.2",
6567
"eslint-config-prettier": "^8.3.0",

packages/frontend/src/Components/Intro/index.tsx

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
import { useState, useEffect } from 'react';
2-
import { Box, Button, Flex, Image, Text, useColorMode } from '@chakra-ui/react';
2+
import {
3+
Box,
4+
Button,
5+
Flex,
6+
Heading,
7+
Image,
8+
Text,
9+
useColorMode,
10+
} from '@chakra-ui/react';
311
import '@fontsource/inter/500.css';
412
import '@fontsource/inter/700.css';
513
import '@fontsource/inter/800.css';
@@ -36,15 +44,15 @@ const IntroComponent = () => {
3644
p="2rem"
3745
>
3846
<Box pr="4rem">
39-
<Text
47+
<Heading
4048
fontFamily="Inter"
4149
fontWeight="800"
4250
mr="2rem"
4351
fontSize={{ base: '2.625rem', xl: '3.375rem' }}
4452
lineHeight={{ base: '2.625rem', xl: '4rem' }}
4553
>
4654
Build web3 with friends.
47-
</Text>
55+
</Heading>
4856
<Text
4957
fontFamily="Inter"
5058
fontWeight="500"

0 commit comments

Comments
 (0)