Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

main merge to cwm #1668

Open
wants to merge 47 commits into
base: cwm
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
41c3d81
fix: pass props to test component
ojafero Dec 9, 2022
c912fef
refactor the badges component to make it reusbale
khalatevarun Jun 16, 2023
e15d615
comment the test temporarily
khalatevarun Jun 16, 2023
1a577cd
use Chip inside Badges
khalatevarun Jun 17, 2023
d4d552f
fix: trigger main release
dadiorchen Jun 17, 2023
9c36627
chore(release): 2.3.2 [skip ci]
semantic-release-bot Jun 17, 2023
b721be7
fix: beta is not in use
dadiorchen Jun 19, 2023
2d3afce
chore(release): 2.3.3 [skip ci]
semantic-release-bot Jun 19, 2023
24b14cc
update badge to render customised chip component
khalatevarun Jun 23, 2023
bd2fdf9
pass custom style in sx prop value
khalatevarun Jun 23, 2023
409fe9c
replace VerifiedBadges with Badge component and remove VerifiedBadges…
khalatevarun Jun 24, 2023
4a3b8c3
Merge pull request #1643 from khalatevarun/refactor/badges
dadiorchen Jun 26, 2023
b1ec6eb
feat: upgrade cypress
dadiorchen Jun 27, 2023
5c3ee5b
fix: broken int test in cypress
dadiorchen Jun 27, 2023
744223c
chore: log
dadiorchen Jun 27, 2023
0f470ca
fix: remove useless tests
dadiorchen Jun 27, 2023
f751401
fix: broken int test cypress because of upgrade
dadiorchen Jun 27, 2023
171defc
Merge pull request #1658 from dadiorchen/issue1654
dadiorchen Jun 27, 2023
85b33f6
chore(release): 2.4.0 [skip ci]
semantic-release-bot Jun 27, 2023
a8c0ff8
chore: clean doc and cmd [skip ci]
dadiorchen Jun 27, 2023
e6dd5fb
fix: badge check
khalatevarun Jun 27, 2023
3a74148
Merge remote-tracking branch 'greenstand/main' into fix-update-test
dadiorchen Jun 28, 2023
824c272
Merge pull request #1275 from ojafero/fix-update-test
dadiorchen Jun 28, 2023
28900bf
chore(release): 2.4.1 [skip ci]
semantic-release-bot Jun 28, 2023
befa3eb
chore: missed cmd [skip ci]
dadiorchen Jun 28, 2023
ccdc330
feat: add prettier check to CI
ojafero Dec 2, 2022
14502d6
merge main
khalatevarun Jun 29, 2023
cec3b60
feat: prettier ignore
dadiorchen Jun 30, 2023
8b8f400
feat: prettier after lint fix
dadiorchen Jun 30, 2023
2054e02
fix: broken test
dadiorchen Jun 30, 2023
b4961cd
chore: code format
dadiorchen Jun 30, 2023
e31fd67
Merge pull request #1229 from ojafero/feat-add-prettier
dadiorchen Jun 30, 2023
c9a910e
chore(release): 2.5.0 [skip ci]
semantic-release-bot Jun 30, 2023
eec66a7
chore: all branch need to ci on PR [skip ci]
dadiorchen Jul 1, 2023
7df8f86
fix: syntax error in yaml
dadiorchen Jul 1, 2023
99d7069
chore(release): 2.5.1 [skip ci]
semantic-release-bot Jul 1, 2023
4ed95c8
fix: don't pretieer
dadiorchen Jul 1, 2023
b29b230
Merge pull request #1666 from dadiorchen/no-prettier
dadiorchen Jul 1, 2023
9c2ace3
chore(release): 2.5.2 [skip ci]
semantic-release-bot Jul 1, 2023
3788fbd
fix: badge check
khalatevarun Jun 27, 2023
e396711
Merge branch 'fix/badge-check' of https://github.com/khalatevarun/tre…
dadiorchen Jul 1, 2023
9eaf061
Merge pull request #1659 from khalatevarun/fix/badge-check
dadiorchen Jul 1, 2023
2e9df89
chore(release): 2.5.3 [skip ci]
semantic-release-bot Jul 1, 2023
0d72bdd
chore: use changelog from cwm
dadiorchen Jul 1, 2023
8941e91
chore: use version of cwm
dadiorchen Jul 1, 2023
ff7366d
chore: use env from cwm
dadiorchen Jul 1, 2023
72928d1
chore: merge from cwm
dadiorchen Jul 1, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ module.exports = {

// allow test files to use dev dependencies
'import/no-extraneous-dependencies': [
'error',
'warn',
{
devDependencies: [
'**/*.{test,cy,spec}.js',
Expand Down Expand Up @@ -71,6 +71,10 @@ module.exports = {
'prefer-destructuring': 'warn',
'no-unreachable': 'warn',
'cypress/unsafe-to-chain-command': 'warn',
'import/no-extraneous-dependencies': 'warn',
'global-require': 'warn',
'import/extensions': 'warn',
'no-dupe-keys': 'warn',
},

reportUnusedDisableDirectives: true,
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pull-request-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:
- name: Run Component tests 🧪
uses: cypress-io/github-action@v4
with:
command: npx cypress run-ct
command: npm run cypress:run:component

- name: Jest Unit Tests 🧪
run: npx jest --ci
Expand Down
5 changes: 1 addition & 4 deletions .lintstagedrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,8 @@ module.exports = {
// import alias for uniform pattern of imports
'src/**/*.js': ['jscodeshift -t scripts/codeshift.js'],

// format all file types recognized by prettier
'*': ['prettier --ignore-unknown --write'],

// lint javascript after formatting
'*.{js,jsx}': ['eslint --fix --cache'],
'*.{js,jsx}': ['eslint --fix --cache', 'prettier --ignore-unknown --write'],

// lint entire project if eslint settings changed, do not pass file name arguments
'.eslint*': () => 'eslint . --cache',
Expand Down
6 changes: 5 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,8 @@
**/dist/**
package-lock.json
coverage
node_modules
node_modules
*.md
*.yaml
deployment*
doc
5 changes: 0 additions & 5 deletions .releaserc.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@
"master",
"next",
"next-major",
{
"name": "beta",
"prerelease": true,
"channel": "beta"
},
{
"name": "v2",
"prerelease": true,
Expand Down
9 changes: 2 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ We recommend using Cypress's component testing tool to build components in isola
**To run Cypress unit/component tests:**

```
npm run cyu
npm run cypress:open
```

[Video tutorial for building component](https://loom.com/share/c750be68ecec4a9b99cb6921d2d2e041)
Expand Down Expand Up @@ -189,12 +189,6 @@ Also, integration tests bring some benefits for the development workflow - by mo

**To run Cypress integration tests:**

Open cypress test viewer

```
npm run cypress:open
```

Nextjs dev server + Cypress test viewer + nock

```
Expand Down Expand Up @@ -443,3 +437,4 @@ Sometimes we need to connect production data (map, tree) to debug, to do so, cop
.
.
.
.
34 changes: 34 additions & 0 deletions cypress.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
const { defineConfig } = require('cypress');

module.exports = defineConfig({
viewportWidth: 1440,
viewportHeight: 800,
nodeVersion: 'system',

'cypress-watch-and-reload': {
watch: ['src/**'],
},

e2e: {
// We've imported your old cypress plugins here.
// You may want to clean this up later by importing these.
setupNodeEvents(on, config) {
return require('./cypress/plugins/index.js')(on, config);
},
baseUrl: 'http://localhost:3000',
specPattern: 'cypress/tests/**/*.cy.{js,jsx,ts,tsx}',
},

component: {
setupNodeEvents(on, config) {},
supportFile: 'cypress/support/components-testing.js',
specPattern: 'src/**/*.cy.{js,jsx,ts,tsx}',
},

component: {
devServer: {
framework: 'next',
bundler: 'webpack',
},
},
});
19 changes: 0 additions & 19 deletions cypress.json

This file was deleted.

5 changes: 4 additions & 1 deletion cypress/plugins/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ module.exports = async (on, config) => {
config.env.NEXT_PUBLIC_BASE = process.env.NEXT_PUBLIC_BASE;

// exit if not using nock to mock nextjs ssr functions
if (!config.env.nock) return config;
if (!config.env.nock) {
console.warn("Cypress.env('nock') is not set, skipping nock preparation");
return config;
}

const app = next({ dev: true });
const handleNextRequests = app.getRequestHandler();
Expand Down
14 changes: 14 additions & 0 deletions cypress/support/component-index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
<title>Components App</title>
<!-- Used by Next.js to inject CSS. -->
<div id="__next_css__DO_NOT_USE__"></div>
</head>
<body>
<div data-cy-root></div>
</body>
</html>
27 changes: 27 additions & 0 deletions cypress/support/component.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// ***********************************************************
// This example support/component.js is processed and
// loaded automatically before your test files.
//
// This is a great place to put global configuration and
// behavior that modifies Cypress.
//
// You can change the location of this file or turn off
// automatically serving support files with the
// 'supportFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/configuration
// ***********************************************************

// Import commands.js using ES2015 syntax:
import './commands';

// Alternatively you can use CommonJS syntax:
// require('./commands')

import { mount } from 'cypress/react';

Cypress.Commands.add('mount', mount);

// Example use:
// cy.mount(<MyComponent />)
File renamed without changes.
5 changes: 4 additions & 1 deletion cypress/tests/integration/nockRoutes.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,10 @@ export function getNockRoutes(
}

export function prepareNocks(props) {
if (!Cypress.env('nock')) return;
if (!Cypress.env('nock')) {
console.warn("Cypress.env('nock') is not set, skipping nock preparation");
return;
}
cy.task('nocks', {
hostname: Cypress.env('NEXT_PUBLIC_API'),
routes: getNockRoutes(props),
Expand Down
1 change: 0 additions & 1 deletion cypress/tests/integration/planters/[planterid].cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ describe('Planter page', () => {
cy.visit(path, {
failOnStatusCode: false,
});
cy.contains(planter.id);
cy.get('.MuiTypography-h2').contains(/sebastian g/i);
cy.screenshot();
});
Expand Down
1 change: 0 additions & 1 deletion cypress/tests/integration/wallets/[walletid].cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@ describe('Planter page', () => {
cy.visit(path, {
failOnStatusCode: false,
});
cy.contains(wallet.id);
cy.get('.MuiTypography-h2')
.eq(0)
.contains(/Maynard.Stroman79/i);
Expand Down
Loading