Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added .yarn/cache/fsevents-patch-6b67494872-10c0.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
19 changes: 16 additions & 3 deletions cypress.config.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,28 @@
import { defineConfig } from 'cypress';
import viteConfig from './vite.config.packages.js';

export default defineConfig({
projectId: '2hroh3',

e2e: {
baseUrl: 'http://127.0.0.1:4000/design-system/',
defaultCommandTimeout: 40000,
specPattern: 'test/cypress/e2e/**/*.cy.{js,jsx,ts,tsx}',
supportFile: 'test/cypress/support/e2e.js',
excludeSpecPattern: 'test/cypress/e2e/**/*-helpers.cy.js',
specPattern: 'cypress/e2e/**/*.cy.{js,jsx,ts,tsx}',
supportFile: 'cypress/support/e2e.js',
excludeSpecPattern: 'cypress/e2e/**/*-helpers.cy.js',
setupNodeEvents(/*on, config*/) {
// implement node event listeners here
},
},

component: {
supportFile: 'cypress/support/component.js',
devServer: {
framework: 'cypress-ct-lit',
bundler: 'vite',
viteConfig: viteConfig,
},
indexHtmlFile: 'cypress/support/component-index.html',
},
experimentalWebKitSupport: true,
});
15 changes: 15 additions & 0 deletions cypress/component/button.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { html } from 'lit';
import {CfpbButton} from '@cfpb/cfpb-design-system/src/elements/cfpb-button';

describe('<cfpb-button />', () => {
before(() => {
CfpbButton.init();
});

it('renders a button', () => {
cy.mount(html`<cfpb-button>Click me</cfpb-button>`);
cy.contains('Click me').should('exist');

cy.get('cfpb-button').shadow().find('button').should('have.class', 'a-btn');
});
});
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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>
17 changes: 17 additions & 0 deletions cypress/support/component.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// ***********************************************************
// 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 { mount } from 'cypress-ct-lit'

Cypress.Commands.add('mount', mount)
File renamed without changes.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
"concurrently": "9.2.1",
"cssnano": "7.1.2",
"cypress": "15.10.0",
"cypress-ct-lit": "1.0.0",
"esbuild": "0.27.3",
"esbuild-plugin-liquid": "0.2.0",
"esbuild-plugin-minify-html-literals": "3.0.0",
Expand Down
11 changes: 11 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4799,6 +4799,7 @@ __metadata:
concurrently: "npm:9.2.1"
cssnano: "npm:7.1.2"
cypress: "npm:15.10.0"
cypress-ct-lit: "npm:1.0.0"
decap-cms-app: "npm:3.10.0"
esbuild: "npm:0.27.3"
esbuild-plugin-liquid: "npm:0.2.0"
Expand Down Expand Up @@ -5689,6 +5690,16 @@ __metadata:
languageName: node
linkType: hard

"cypress-ct-lit@npm:1.0.0":
version: 1.0.0
resolution: "cypress-ct-lit@npm:1.0.0"
peerDependencies:
cypress: ">=10.6.0"
lit: ^2.0.0 || ^3.0.0
checksum: 10c0/bc32e29c4cd6e3b0af303943e77b352f8405dee49e5c62185f2a804702354cc0a500fe0f4c2068861cc98068d5b2a86d5c0d097d6d5d01b380b2f32559bd4875
languageName: node
linkType: hard

"cypress@npm:15.10.0":
version: 15.10.0
resolution: "cypress@npm:15.10.0"
Expand Down
Loading