Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
170 commits
Select commit Hold shift + click to select a range
faa2292
feat: add decap-cms-ui-4
martinjagodic Oct 24, 2023
1d33f25
feat: update emotion, package version
martinjagodic Oct 24, 2023
67d936d
feat: add dependencies and webpack include
martinjagodic Oct 25, 2023
d4b241d
feat: add card to some components
martinjagodic Oct 25, 2023
13313a7
feat: update storybook
martinjagodic Oct 25, 2023
988ea8d
feat: import buttons from ui-4
martinjagodic Oct 26, 2023
cb9d946
feat: add new auth page
martinjagodic Oct 26, 2023
00950d6
feat: set viewport meta on dev-test indexes
martinjagodic Oct 26, 2023
441152d
fix: remove card
martinjagodic Nov 2, 2023
0041ece
feat: update storybook
martinjagodic Nov 3, 2023
3808ea0
feat: implemented base theming
Daniel-Mendes Feb 5, 2024
2a877da
feat: wip porting all components
Daniel-Mendes Feb 5, 2024
e49ae21
feat(ui): continue porting and first load without error
Daniel-Mendes Feb 6, 2024
6668ff6
fix: fixes crash when user is not auth
Daniel-Mendes Feb 6, 2024
97e64b6
Merge branch 'master' into next
Daniel-Mendes Feb 7, 2024
83020f0
docs: implemented storybook for the buttons components
Daniel-Mendes Feb 7, 2024
1cd4eb6
feat(storybook): add theme, dark mode and viewports
Daniel-Mendes Feb 7, 2024
4c01a52
feat(storybook): add Dialog story
Daniel-Mendes Feb 7, 2024
78c0329
feat(storybook): add Avatar story
Daniel-Mendes Feb 7, 2024
2006669
feat(storybook): add Icon and Menu stories
Daniel-Mendes Feb 7, 2024
27320c8
feat(storybook): add story for SearchBar
Daniel-Mendes Feb 8, 2024
01cfa3d
feat(storybook): add story for AppBar
Daniel-Mendes Feb 8, 2024
b3a2fae
feat(storybook): add story for NavMenu
Daniel-Mendes Feb 8, 2024
77a8a55
feat(storybook): add story for ToggleSwitch
Daniel-Mendes Feb 8, 2024
ce405ab
feat(storybook): add story for Card
Daniel-Mendes Feb 8, 2024
b36481d
feat(storybook): add story for Tag
Daniel-Mendes Feb 8, 2024
2cc3bff
feat(storybook): add story for Icon Library
Daniel-Mendes Feb 8, 2024
10c1604
feat(storybook): implemented Avatar with initials
Daniel-Mendes Feb 8, 2024
a9a82b5
fix: fixed UIContext not updated
Daniel-Mendes Feb 8, 2024
257c793
fix(storybook): fix Menu story crashing
Daniel-Mendes Feb 8, 2024
2375a6c
feat: wip toast compoent
Daniel-Mendes Feb 8, 2024
ca9255c
fix: fixed toast component
Daniel-Mendes Feb 9, 2024
4b56a9a
feat(storybook): add thumbnail story
Daniel-Mendes Feb 9, 2024
c270c64
refactor: replaced custom implementation of Toast with extending reac…
Daniel-Mendes Feb 9, 2024
3425965
feat: wip implementing react-toastify notification center
Daniel-Mendes Feb 9, 2024
245dd84
Merge branch 'decaporg:master' into next
Daniel-Mendes Feb 10, 2024
ccd447e
feat: working on ListInput component
Daniel-Mendes Feb 13, 2024
a175a1c
feat(storybook): added BoleanInput story
Daniel-Mendes Feb 13, 2024
6f70e65
feat(storybook): added DateInput story
Daniel-Mendes Feb 13, 2024
5052863
feat(storybook): added SelectInput story
Daniel-Mendes Feb 13, 2024
3a550d9
feat(storybook): added ObjectInput story
Daniel-Mendes Feb 13, 2024
9310db0
feat(storybook): added TextInput story
Daniel-Mendes Feb 13, 2024
3ecee42
refactor: improved a11y of ToggleSwitch component
Daniel-Mendes Feb 13, 2024
2697b46
feat: implemented AppBar and Search
Daniel-Mendes Feb 13, 2024
caff1d3
Merge branch 'decaporg:master' into next
Daniel-Mendes Feb 13, 2024
c3610c8
feat(storybook): added ThumbnailGrid story
Daniel-Mendes Feb 15, 2024
0cdb47f
fix: fixed dark mode switching
Daniel-Mendes Feb 15, 2024
b687dd5
feat: added icon, position and url to config.yml and validation
Daniel-Mendes Feb 15, 2024
04d9ccc
feat: new menu style and NavLink from react-router
Daniel-Mendes Feb 15, 2024
3cf2a98
feat: new header style
Daniel-Mendes Feb 15, 2024
8abbcbf
refactor: move to new app layout structure
Daniel-Mendes Feb 15, 2024
f403bd3
fix: fixed export component Icon
Daniel-Mendes Feb 15, 2024
f92fb70
fix: fixed wrong quick add collections
Daniel-Mendes Feb 15, 2024
a855b00
refactor: refactored site_url nav section to use NavMenuLink component
Daniel-Mendes Feb 15, 2024
3444873
feat: displayes an icon if no image and no initials in UserAvatar
Daniel-Mendes Feb 15, 2024
95b948c
feat: allow custom Icon component in nav (for custo logo)
Daniel-Mendes Feb 16, 2024
f1c5d5c
fix: fixed search bar background-color and removed clear icon
Daniel-Mendes Feb 16, 2024
e663a86
fix: fixed media dialog tumb grid height
Daniel-Mendes Feb 16, 2024
50ff20b
feat(storybook): added story for MediaDialog
Daniel-Mendes Feb 16, 2024
fbd6b3d
refactor(storybook): implemented mockData with faker
Daniel-Mendes Feb 16, 2024
cb859fb
feat: added style for scrollbar
Daniel-Mendes Feb 16, 2024
22d1457
fix: fixed dragging ListInput
Daniel-Mendes Feb 17, 2024
554f3dd
feat: wip of Table Component
Daniel-Mendes Feb 17, 2024
3722dc2
refactor: faker replace deprecated field
Daniel-Mendes Feb 17, 2024
3a921b3
refactor: renamed transition folder
Daniel-Mendes Feb 17, 2024
ac56db0
refactor: code cleanup
Daniel-Mendes Feb 17, 2024
035c5ab
feat: push package-lock
Daniel-Mendes Feb 17, 2024
fc92d5e
fix: fixed Table component error with rendering
Daniel-Mendes Feb 18, 2024
b56ac19
feat: wip implementing AuthenticationPage
Daniel-Mendes Feb 18, 2024
74464f8
feat: implemented Table in MediaDialog
Daniel-Mendes Feb 18, 2024
d52eba0
refactor: renamed avatar initials props to fallback
Daniel-Mendes Mar 2, 2024
861f283
refactor: bump decap-cms-ui-next to version 4.0.0
Daniel-Mendes Mar 2, 2024
e744207
refactor: rename avatar initials to fallback
Daniel-Mendes Mar 2, 2024
c05dcf2
feat: working on collection controls
Daniel-Mendes Mar 2, 2024
bf8a32a
style: chang decap logo in config
Daniel-Mendes Mar 2, 2024
08a0dd6
Merge remote-tracking branch 'upstream/next' into next
Daniel-Mendes Mar 6, 2024
3f6a3a7
refactor: migrate decap-cms-ui-4 to decap-cms-ui-next
Daniel-Mendes Mar 6, 2024
492a579
chore: add decap-cms-ui-next dep to aws backend
Daniel-Mendes Mar 6, 2024
590b233
refactor: remove old Header
Daniel-Mendes Mar 6, 2024
675bd9f
refactor: replace Logo with DecapMark, DecapWordmark and DecapTile co…
Daniel-Mendes Mar 9, 2024
f5615df
fix: fixed storybook decap logo on darkmode
Daniel-Mendes Mar 9, 2024
2625e88
refactor(storybook): improve components order
Daniel-Mendes Mar 9, 2024
c1909a5
refactor: cleanup webpack config
Daniel-Mendes Mar 9, 2024
d4a87c5
fix: added missing package
Daniel-Mendes Mar 9, 2024
f29a848
refactor: cleanup import
Daniel-Mendes Mar 9, 2024
a485aad
refactor: added startContent and endContent to MenuItem
Daniel-Mendes Mar 10, 2024
b0002cf
fix: fixed error build with old Logo imports
Daniel-Mendes Mar 10, 2024
2cca8c2
refactor: migrate collection controls to decap-cms-ui-next components
Daniel-Mendes Mar 11, 2024
7ed3b4e
feat: implement new entries grid
Daniel-Mendes Mar 30, 2024
559ff19
feat: implement new entries table
Daniel-Mendes Mar 30, 2024
b5824c6
style: improve layout paddings and margins
Daniel-Mendes Mar 30, 2024
fe77a56
feat: implement new design for workflow
Daniel-Mendes Mar 30, 2024
279e905
fix: fixed workflow card style
Daniel-Mendes Apr 1, 2024
920ad33
fix: fixed search bar focus and hover bgColor
Daniel-Mendes Apr 1, 2024
a759467
fix: fixed workflow flex direction
Daniel-Mendes Apr 1, 2024
356bf30
feat: implemented new toast notif
Daniel-Mendes Apr 1, 2024
1e33817
feat: working on editor components
Daniel-Mendes Apr 1, 2024
06cd67b
refactor: migrate MenuItem icon and endIcon
Daniel-Mendes Apr 2, 2024
f7d7846
feat: implemented new TextInput
Daniel-Mendes Apr 2, 2024
3d241d5
style: switch draft color on workflow header
Daniel-Mendes Apr 2, 2024
a3b8e41
fix: fixed webpack not resolving .jsx files
Daniel-Mendes Apr 3, 2024
866e7cd
feat: implemented TextInput status, hint , title and errors
Daniel-Mendes Apr 3, 2024
9b1315e
feat: widget implement placeholder
Daniel-Mendes Apr 4, 2024
1a608ad
feat: new NumberInput component and migrate NumberControl
Daniel-Mendes Apr 4, 2024
dfcda47
feat: migrated BooleanControl to BooleanInput
Daniel-Mendes Apr 4, 2024
7f487cb
refactor: fixed small bugs in Editor
Daniel-Mendes Apr 4, 2024
26fdf9e
feat(storybook): added colors, shadows, typo stories
Daniel-Mendes Apr 4, 2024
519af8d
refactor(storybook): moved icons library and logos folders
Daniel-Mendes Apr 4, 2024
164ad6b
style: replaced ListInputItem icon from x to trash to prevent deletin…
Daniel-Mendes Apr 4, 2024
cb448fe
chore(deps): migrate to Storybook 8
Daniel-Mendes Apr 5, 2024
1f2dd81
feat: migrate to DateInput
Daniel-Mendes Apr 5, 2024
2fc58b7
feat: implemented Textarea component
Daniel-Mendes Apr 5, 2024
4a71de1
refactor: some improvements to inputs
Daniel-Mendes Apr 5, 2024
06110e3
chore: renamed Inputs to Fields
Daniel-Mendes Apr 6, 2024
826659c
feat: added ListFieldItem add MenuSeparaton to ListActions
Daniel-Mendes Apr 6, 2024
370bd01
feat: implementing new markdown widget
Daniel-Mendes Apr 14, 2024
666c1f2
feat: implementing new SelectField component
Daniel-Mendes Apr 14, 2024
831cd63
feat: implementing MapControl new style
Daniel-Mendes Apr 14, 2024
f38aa4a
refactor: improve NumberField
Daniel-Mendes Apr 14, 2024
9f7d478
refactor: implement Dropdown component on top of Menu component
Daniel-Mendes Apr 17, 2024
ac12992
refactor: implement Toggle and Switch component
Daniel-Mendes Apr 17, 2024
7e5f548
feat: wip fields
Daniel-Mendes Apr 17, 2024
183f02b
fix: fixed focus state of number and textarea fields
Daniel-Mendes Apr 20, 2024
315049a
refactor(widget-markdown): improve raw mode switch
Daniel-Mendes Apr 20, 2024
90dd603
refactor(editor): improve toolbar buttons
Daniel-Mendes Apr 20, 2024
495e5ec
chore(style): switch collection view style
Daniel-Mendes Apr 20, 2024
085536a
chore: improve decap and heading icons
Daniel-Mendes Apr 20, 2024
5ca479c
chore(style): change richTextEditorMinHeight value
Daniel-Mendes Apr 20, 2024
64f18e7
refactor: improve editorial workflow
Daniel-Mendes Apr 21, 2024
79e29b6
chore(style): fixed app main height
Daniel-Mendes Apr 21, 2024
b55fa31
feat: implement NestedCollection on nav sidebar
Daniel-Mendes Apr 27, 2024
51c8cde
feat: wip implementing media page and media dialog
Daniel-Mendes Apr 27, 2024
664669a
feat: add Loader component
Daniel-Mendes Apr 28, 2024
c6f8358
fix: fixed filter collection not found
Daniel-Mendes Apr 28, 2024
47aa816
feat: themed raw editor
Daniel-Mendes Apr 28, 2024
a9acdb1
feat: implementing media assets
Daniel-Mendes May 12, 2024
a28b23f
fix: don't open media popup when displaying media page
Daniel-Mendes May 18, 2024
660c1f8
feat: wip Media Library and Widget Image
Daniel-Mendes May 18, 2024
dd58549
feat: new style for search results
Daniel-Mendes Jun 2, 2024
b735a37
feat: add icons to titles
Daniel-Mendes Jun 2, 2024
aa363be
refactor: imrpove media library
Daniel-Mendes Jun 2, 2024
3630bf8
feat: add icons to config collections
Daniel-Mendes Jun 2, 2024
b82debf
feat: simplify publish button
Daniel-Mendes Jun 2, 2024
1520338
refactor: extract collection's resources to own category
Daniel-Mendes Jun 15, 2024
916ff6f
chore: bump storybook version
Daniel-Mendes Jun 15, 2024
5ee2195
fix: fallback to label when collection entry has no inferredField title
Daniel-Mendes Jun 15, 2024
689b109
feat: added ObjectControl and wip ListControl
Daniel-Mendes Jun 15, 2024
690aa81
refactor: extract <Field> from widgets
Daniel-Mendes Aug 3, 2024
b2c2f18
feat: implementing site analytics in dashboard
Daniel-Mendes Aug 4, 2024
47e1301
feat: implements simple analytics date range
Daniel-Mendes Aug 14, 2024
0a50fa0
refactor: migrated tag to badge and added size, radius and variant prop
Daniel-Mendes Aug 14, 2024
7f6b102
refactor: migrate to new app layout
Daniel-Mendes Aug 14, 2024
ce16ddc
chore(ui): migrate workflow design
Daniel-Mendes Aug 14, 2024
8b68227
refactor: improve branding and resource redux state management
Daniel-Mendes Aug 14, 2024
679341f
feat: implement workflow cards in dashboard
Daniel-Mendes Aug 15, 2024
8973d3f
fix: fix Inter font superseeded
Daniel-Mendes Aug 15, 2024
bedc65a
feat: add badge to header
Daniel-Mendes Aug 15, 2024
62d7bb6
chore(storybook): migrate storybook config to typescript
Daniel-Mendes Aug 15, 2024
ea73703
feat: implementing custom AlertDialog to replace window.alert, confir…
Daniel-Mendes Aug 15, 2024
b80913e
chore(ui): fix small color contrasts
Daniel-Mendes Aug 15, 2024
50fca4e
feat: add component interaction tests, snapshot tests, visual tests a…
Daniel-Mendes Aug 19, 2024
ce11fda
refactor: add default actionButton and cancelButton labels
Daniel-Mendes Aug 19, 2024
ec7f2bf
refactor: small configs fixes
Daniel-Mendes Aug 19, 2024
bf41a4f
fix: fixing font inter import
Daniel-Mendes Aug 19, 2024
40bb9c6
refactor: update to new Button props
Daniel-Mendes Aug 19, 2024
b0d059d
chore(test): add AuthenticationPage snapshot
Daniel-Mendes Aug 19, 2024
70c0053
fix: fixing AlertDialogProvider t prop undefined
Daniel-Mendes Aug 20, 2024
cd68725
Merge remote-tracking branch 'origin/next-ui' into next
martinjagodic Aug 22, 2024
b63486d
fix: remove storybook preview.jsx (.tsx already exists)
martinjagodic Aug 23, 2024
9490f5d
fix: rename storyblok build script
martinjagodic Aug 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ module.exports = {
'plugin:cypress/recommended',
'prettier',
'plugin:import/recommended',
'plugin:storybook/recommended',
],
env: {
es6: true,
Expand Down Expand Up @@ -87,8 +88,10 @@ module.exports = {
jsx: true,
},
},
plugins: ['@typescript-eslint', 'babel', '@emotion', 'cypress', 'unicorn'],
rules: {
'no-duplicate-imports': [0], // handled by @typescript-eslint
'react/prop-types': [0],
'@typescript-eslint/ban-types': [0], // TODO enable in future
'@typescript-eslint/no-non-null-assertion': [0],
'@typescript-eslint/consistent-type-imports': 'error',
Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:
pull_request:
types: [opened, synchronize, reopened]

# Note: Needs write permimission to upload __image_snapshots__ folder
permissions:
contents: write

jobs:
changes:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -56,6 +60,7 @@ jobs:

e2e-with-cypress:
needs: [changes, build]
timeout-minutes: 60
runs-on: ubuntu-latest

strategy:
Expand Down Expand Up @@ -98,3 +103,27 @@ jobs:
path: |
cypress/screenshots
cypress/videos

component-test-with-storybook:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x, 20.x]
fail-fast: false

steps:
- uses: actions/checkout@v3
- name: Use Node.js { matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
check-latest: true
- name: Install dependencies
run: npm install
- name: Install Playwright
run: npx playwright install --with-deps
- name: Build Storybook
run: npm run build:storybook
- name: Run component tests
run: npm run test:component
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ bin/
public/
node_modules/
npm-debug.log
*.tsbuildinfo
.DS_Store
.tern-project
yarn-error.log
Expand All @@ -13,6 +14,7 @@ manifest.yml
cypress/videos
cypress/screenshots
__diff_output__
__image_snapshots__
coverage/
.cache
*.log
Expand Down
10 changes: 5 additions & 5 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,21 @@ function getAbsolutePath(value: string): any {
}

const config: StorybookConfig = {
stories: ['../packages/**/src/**/?(*.)(story|stories).(js|jsx|ts|tsx)'],
stories: ['../packages/**/src/**/?(*.)(story|stories).(js|jsx|ts|tsx|mdx)'],

addons: [
getAbsolutePath('@storybook/addon-essentials'),
getAbsolutePath('@storybook/addon-interactions'),
getAbsolutePath('@storybook/addon-storysource'),
getAbsolutePath('@storybook/addon-a11y'),
getAbsolutePath('storybook-addon-deep-controls'),
getAbsolutePath('storybook-dark-mode'),
getAbsolutePath('@storybook/addon-webpack5-compiler-babel'),
],

framework: {
name: getAbsolutePath('@storybook/react-webpack5'),
options: {},
},
docs: {
autodocs: 'tag',
},
};

export default config;
56 changes: 0 additions & 56 deletions .storybook/preview.jsx

This file was deleted.

64 changes: 64 additions & 0 deletions .storybook/preview.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
import React from 'react';
import { Preview } from '@storybook/react';
import { DocsContainer } from '@storybook/addon-docs';
import { themes } from '@storybook/theming';
import { useDarkMode } from 'storybook-dark-mode';
import { ThemeProvider } from '@emotion/react';
import { I18n } from 'react-polyglot';
import { en } from 'decap-cms-locales';
import { lightTheme, darkTheme, UIProvider, GlobalStyles } from 'decap-cms-ui-next';
import themeViewports from './viewports';
import brandTheme from './theme';

const preview: Preview = {
decorators: [
Story => {
const darkMode = useDarkMode();
const theme = darkMode ? { darkMode, ...darkTheme } : { darkMode, ...lightTheme };

return (
<I18n locale="en" messages={en}>
<UIProvider value={{ darkMode }}>
<ThemeProvider theme={theme}>
<GlobalStyles />

<Story />
</ThemeProvider>
</UIProvider>
</I18n>
);
},
],
parameters: {
layout: 'centered',
viewport: {
viewports: {
...themeViewports,
},
},
options: {
showPanel: true,
storySort: {
method: 'alphabetical',
order: ['Foundations', 'Pages', 'Components', 'Fields'],
},
},
deepControls: { enabled: true },
darkMode: {
dark: { ...themes.dark, ...brandTheme.dark },
light: { ...themes.normal, ...brandTheme.light },
},
docs: {
container: props => {
const isDark = useDarkMode();
const currentProps = { ...props };
currentProps.theme = isDark
? { ...themes.dark, ...brandTheme.dark }
: { ...themes.normal, ...brandTheme.light };
return React.createElement(DocsContainer, currentProps);
},
},
},
};

export default preview;
38 changes: 38 additions & 0 deletions .storybook/test-runner.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import type { TestRunnerConfig } from '@storybook/test-runner';
import { injectAxe, checkA11y } from 'axe-playwright';

import { waitForPageReady } from '@storybook/test-runner';

import { toMatchImageSnapshot } from 'jest-image-snapshot';

const config: TestRunnerConfig = {
setup() {
expect.extend({ toMatchImageSnapshot });
},
async preVisit(page) {
await injectAxe(page);
},
async postVisit(page) {
// Awaits for the page to be loaded and available including assets (e.g., fonts)
// await waitForPageReady(page);

// Checks for accessibility issues
await checkA11y(page, '#storybook-root', {
detailedReport: true,
detailedReportOptions: {
html: true,
},
});

// Generates a DOM snapshot file based on the story identifier
const elementHandler = await page.$('#storybook-root');
const innerHTML = await elementHandler.innerHTML();
expect(innerHTML).toMatchSnapshot();

// Generates a Visual snapshot file based on the story identifier
const image = await elementHandler.screenshot();
expect(image).toMatchImageSnapshot();
},
};

export default config;
16 changes: 15 additions & 1 deletion cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ import { defineConfig } from 'cypress';

export default defineConfig({
projectId: '1c35bs',

retries: {
runMode: 4,
openMode: 0,
},

e2e: {
video: false,
// We've imported your old cypress plugins here.
Expand All @@ -15,6 +17,18 @@ export default defineConfig({
return require('./cypress/plugins/index.js')(on, config);
},
baseUrl: 'http://localhost:8080',
specPattern: 'cypress/e2e/*spec*.js',
specPattern: [
'cypress/e2e/*spec*.js',
'cypress/component/**/*.spec.cy.{js,jsx,ts,tsx}',
'packages/decap-cms-ui-next/src/**/__tests__/*.spec.cy.{js,jsx,ts,tsx}',
],
},

// component: {
// devServer: {
// framework: 'react',
// bundler: 'webpack',
// webpackConfig: 'scripts/webpack.js',
// },
// },
});
37 changes: 37 additions & 0 deletions cypress/support/commands.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/// <reference types="cypress" />
// ***********************************************
// This example commands.ts shows you how to
// create various custom commands and overwrite
// existing commands.
//
// For more comprehensive examples of custom
// commands please read more here:
// https://on.cypress.io/custom-commands
// ***********************************************
//
//
// -- This is a parent command --
// Cypress.Commands.add('login', (email, password) => { ... })
//
//
// -- This is a child command --
// Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... })
//
//
// -- This is a dual command --
// Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... })
//
//
// -- This will overwrite an existing command --
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })
//
// declare global {
// namespace Cypress {
// interface Chainable {
// login(email: string, password: string): Chainable<void>
// drag(subject: string, options?: Partial<TypeOptions>): Chainable<Element>
// dismiss(subject: string, options?: Partial<TypeOptions>): Chainable<Element>
// visit(originalFn: CommandOriginalFn, url: string, options: Partial<VisitOptions>): Chainable<Element>
// }
// }
// }
12 changes: 12 additions & 0 deletions cypress/support/component-index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!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>
</head>
<body>
<div data-cy-root></div>
</body>
</html>
39 changes: 39 additions & 0 deletions cypress/support/component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// ***********************************************************
// This example support/component.ts 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/react18'

// Augment the Cypress namespace to include type definitions for
// your custom command.
// Alternatively, can be defined in cypress/support/component.d.ts
// with a <reference path="./component" /> at the top of your spec.
declare global {
namespace Cypress {
interface Chainable {
mount: typeof mount
}
}
}

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

// Example use:
// cy.mount(<MyComponent />)
Loading