diff --git a/.yarn/cache/@esbuild-linux-x64-npm-0.27.3-2041dd7b27-10c0.zip b/.yarn/cache/@esbuild-darwin-arm64-npm-0.27.3-4c8fed986d-10c0.zip similarity index 55% rename from .yarn/cache/@esbuild-linux-x64-npm-0.27.3-2041dd7b27-10c0.zip rename to .yarn/cache/@esbuild-darwin-arm64-npm-0.27.3-4c8fed986d-10c0.zip index 91ee230bb8..98eb15d050 100644 Binary files a/.yarn/cache/@esbuild-linux-x64-npm-0.27.3-2041dd7b27-10c0.zip and b/.yarn/cache/@esbuild-darwin-arm64-npm-0.27.3-4c8fed986d-10c0.zip differ diff --git a/.yarn/cache/@parcel-watcher-darwin-arm64-npm-2.4.1-7294eb72cd-10c0.zip b/.yarn/cache/@parcel-watcher-darwin-arm64-npm-2.4.1-7294eb72cd-10c0.zip new file mode 100644 index 0000000000..81882cb85f Binary files /dev/null and b/.yarn/cache/@parcel-watcher-darwin-arm64-npm-2.4.1-7294eb72cd-10c0.zip differ diff --git a/.yarn/cache/@parcel-watcher-linux-x64-glibc-npm-2.4.1-e13cc4f7d9-10c0.zip b/.yarn/cache/@parcel-watcher-linux-x64-glibc-npm-2.4.1-e13cc4f7d9-10c0.zip deleted file mode 100644 index cef219b60b..0000000000 Binary files a/.yarn/cache/@parcel-watcher-linux-x64-glibc-npm-2.4.1-e13cc4f7d9-10c0.zip and /dev/null differ diff --git a/.yarn/cache/@unrs-resolver-binding-darwin-arm64-npm-1.8.1-1a5f033abb-10c0.zip b/.yarn/cache/@unrs-resolver-binding-darwin-arm64-npm-1.8.1-1a5f033abb-10c0.zip new file mode 100644 index 0000000000..b36124e8db Binary files /dev/null and b/.yarn/cache/@unrs-resolver-binding-darwin-arm64-npm-1.8.1-1a5f033abb-10c0.zip differ diff --git a/.yarn/cache/@unrs-resolver-binding-linux-x64-gnu-npm-1.8.1-6ffc954440-10c0.zip b/.yarn/cache/@unrs-resolver-binding-linux-x64-gnu-npm-1.8.1-6ffc954440-10c0.zip deleted file mode 100644 index 7f1948889e..0000000000 Binary files a/.yarn/cache/@unrs-resolver-binding-linux-x64-gnu-npm-1.8.1-6ffc954440-10c0.zip and /dev/null differ diff --git a/.yarn/cache/cypress-ct-lit-npm-1.0.0-c151e19e63-bc32e29c4c.zip b/.yarn/cache/cypress-ct-lit-npm-1.0.0-c151e19e63-bc32e29c4c.zip new file mode 100644 index 0000000000..4a19d6ba11 Binary files /dev/null and b/.yarn/cache/cypress-ct-lit-npm-1.0.0-c151e19e63-bc32e29c4c.zip differ diff --git a/.yarn/cache/fsevents-patch-6b67494872-10c0.zip b/.yarn/cache/fsevents-patch-6b67494872-10c0.zip new file mode 100644 index 0000000000..996683a7d3 Binary files /dev/null and b/.yarn/cache/fsevents-patch-6b67494872-10c0.zip differ diff --git a/.yarn/cache/git-cliff-darwin-arm64-npm-2.12.0-8e469e9879-10c0.zip b/.yarn/cache/git-cliff-darwin-arm64-npm-2.12.0-8e469e9879-10c0.zip new file mode 100644 index 0000000000..bfacae4a1c Binary files /dev/null and b/.yarn/cache/git-cliff-darwin-arm64-npm-2.12.0-8e469e9879-10c0.zip differ diff --git a/.yarn/cache/git-cliff-linux-x64-npm-2.12.0-8e1023cc55-10c0.zip b/.yarn/cache/git-cliff-linux-x64-npm-2.12.0-8e1023cc55-10c0.zip deleted file mode 100644 index 60e653953f..0000000000 Binary files a/.yarn/cache/git-cliff-linux-x64-npm-2.12.0-8e1023cc55-10c0.zip and /dev/null differ diff --git a/cypress.config.js b/cypress.config.js index 175c7c5356..4bc35b2347 100644 --- a/cypress.config.js +++ b/cypress.config.js @@ -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, }); diff --git a/cypress/component/button.cy.js b/cypress/component/button.cy.js new file mode 100644 index 0000000000..0e43d91f68 --- /dev/null +++ b/cypress/component/button.cy.js @@ -0,0 +1,15 @@ +import { html } from 'lit'; +import {CfpbButton} from '@cfpb/cfpb-design-system/src/elements/cfpb-button'; + +describe('', () => { + before(() => { + CfpbButton.init(); + }); + + it('renders a button', () => { + cy.mount(html`Click me`); + cy.contains('Click me').should('exist'); + + cy.get('cfpb-button').shadow().find('button').should('have.class', 'a-btn'); + }); +}); diff --git a/test/cypress/e2e/docs/decap-cms.cy.js b/cypress/e2e/docs/decap-cms.cy.js similarity index 100% rename from test/cypress/e2e/docs/decap-cms.cy.js rename to cypress/e2e/docs/decap-cms.cy.js diff --git a/test/cypress/e2e/docs/interstitial.cy.js b/cypress/e2e/docs/interstitial.cy.js similarity index 100% rename from test/cypress/e2e/docs/interstitial.cy.js rename to cypress/e2e/docs/interstitial.cy.js diff --git a/test/cypress/e2e/docs/search.cy.js b/cypress/e2e/docs/search.cy.js similarity index 100% rename from test/cypress/e2e/docs/search.cy.js rename to cypress/e2e/docs/search.cy.js diff --git a/test/cypress/e2e/docs/show-details.cy.js b/cypress/e2e/docs/show-details.cy.js similarity index 100% rename from test/cypress/e2e/docs/show-details.cy.js rename to cypress/e2e/docs/show-details.cy.js diff --git a/test/cypress/e2e/packages/cfpb-expandables.cy.js b/cypress/e2e/packages/cfpb-expandables.cy.js similarity index 100% rename from test/cypress/e2e/packages/cfpb-expandables.cy.js rename to cypress/e2e/packages/cfpb-expandables.cy.js diff --git a/test/cypress/e2e/packages/cfpb-forms.cy.js b/cypress/e2e/packages/cfpb-forms.cy.js similarity index 100% rename from test/cypress/e2e/packages/cfpb-forms.cy.js rename to cypress/e2e/packages/cfpb-forms.cy.js diff --git a/test/cypress/fixtures/example.json b/cypress/fixtures/example.json similarity index 100% rename from test/cypress/fixtures/example.json rename to cypress/fixtures/example.json diff --git a/test/cypress/fixtures/profile.json b/cypress/fixtures/profile.json similarity index 100% rename from test/cypress/fixtures/profile.json rename to cypress/fixtures/profile.json diff --git a/test/cypress/fixtures/users.json b/cypress/fixtures/users.json similarity index 100% rename from test/cypress/fixtures/users.json rename to cypress/fixtures/users.json diff --git a/test/cypress/support/commands.js b/cypress/support/commands.js similarity index 100% rename from test/cypress/support/commands.js rename to cypress/support/commands.js diff --git a/cypress/support/component-index.html b/cypress/support/component-index.html new file mode 100644 index 0000000000..ac6e79fd83 --- /dev/null +++ b/cypress/support/component-index.html @@ -0,0 +1,12 @@ + + + + + + + Components App + + +
+ + \ No newline at end of file diff --git a/cypress/support/component.js b/cypress/support/component.js new file mode 100644 index 0000000000..5d4d4baa2e --- /dev/null +++ b/cypress/support/component.js @@ -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) \ No newline at end of file diff --git a/test/cypress/support/e2e.js b/cypress/support/e2e.js similarity index 100% rename from test/cypress/support/e2e.js rename to cypress/support/e2e.js diff --git a/package.json b/package.json index 9798b87739..6614e1ff0b 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/yarn.lock b/yarn.lock index 064e35581d..e026f5f4f8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -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" @@ -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"