-
Notifications
You must be signed in to change notification settings - Fork 272
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: enable JSX in Cypress tests (#10653)
Enable JSX syntax in Cypress tests, further improving the test dev experience as we get TS checks and auto completion for the web components. **Note**: From now on, any changes to tests or creating new tests should use `jsx` for test mounting, instead of `lit-html`. As the same syntax rules apply as in the component templates, there is nothing new to learn and switching is straightforward. **Before:** ```ts cy.mount(html`<ui5-card> <ui5-card-header id="cardHeader2" slot="header" additional-text="4 of 10" title-text="Quick Links" subtitle-text="Quick links sub title" interactive > </ui5-card-header> </ui5-card> `); ``` **After**: ```tsx cy.mount(<Card> <CardHeader id="cardHeader1" slot="header" additionalText="4 of 10" titleText="Quick Links" subtitleText="Quick links sub title" interactive={true} > </CardHeader> </Card> ); ```
- Loading branch information
Showing
127 changed files
with
4,949 additions
and
4,345 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,7 @@ jobs: | |
- uses: actions/checkout@v4 | ||
- uses: actions/[email protected] | ||
with: | ||
node-version: 20 | ||
node-version: 22 | ||
cache: 'yarn' | ||
|
||
- name: Install and Build | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ jobs: | |
|
||
- uses: actions/[email protected] | ||
with: | ||
node-version: 20 | ||
node-version: 22 | ||
cache: 'yarn' | ||
|
||
- name: Install Dependencies | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ jobs: | |
- uses: actions/checkout@v4 | ||
- uses: actions/[email protected] | ||
with: | ||
node-version: 20 | ||
node-version: 22 | ||
cache: 'yarn' | ||
|
||
- name: Install and Build | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ jobs: | |
- uses: actions/checkout@v4 | ||
- uses: actions/[email protected] | ||
with: | ||
node-version: 20 | ||
node-version: 22 | ||
cache: 'yarn' | ||
|
||
- name: Install and Build | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,7 @@ jobs: | |
- uses: actions/checkout@v4 | ||
- uses: actions/[email protected] | ||
with: | ||
node-version: 20 | ||
node-version: 22 | ||
cache: 'yarn' | ||
|
||
- name: Install and Build | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ jobs: | |
fetch-depth: 0 | ||
- uses: actions/[email protected] | ||
with: | ||
node-version: 20 | ||
node-version: 22 | ||
cache: 'yarn' | ||
|
||
- name: Install | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,7 @@ jobs: | |
|
||
- uses: actions/[email protected] | ||
with: | ||
node-version: 20 | ||
node-version: 22 | ||
cache: 'yarn' | ||
|
||
- name: Install Dependencies | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ jobs: | |
fetch-depth: 0 | ||
- uses: actions/[email protected] | ||
with: | ||
node-version: 20 | ||
node-version: 22 | ||
cache: 'yarn' | ||
|
||
- name: Install | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,7 @@ jobs: | |
fetch-depth: 0 | ||
- uses: actions/[email protected] | ||
with: | ||
node-version: 20 | ||
node-version: 22 | ||
cache: 'yarn' | ||
|
||
- name: Install | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ jobs: | |
- uses: actions/checkout@v4 | ||
- uses: actions/[email protected] | ||
with: | ||
node-version: 20 | ||
node-version: 22 | ||
cache: 'yarn' | ||
|
||
- name: Install | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,7 @@ jobs: | |
fetch-depth: 0 | ||
- uses: actions/[email protected] | ||
with: | ||
node-version: 20 | ||
node-version: 22 | ||
cache: 'yarn' | ||
|
||
- name: Install | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,7 @@ jobs: | |
fetch-depth: 0 | ||
- uses: actions/[email protected] | ||
with: | ||
node-version: 20 | ||
node-version: 22 | ||
cache: 'yarn' | ||
|
||
- name: Install | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,7 +27,7 @@ jobs: | |
fetch-depth: 0 | ||
- uses: actions/[email protected] | ||
with: | ||
node-version: 20 | ||
node-version: 22 | ||
cache: 'yarn' | ||
|
||
- name: Install | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import cypressConfig from "@ui5/webcomponents-tools/components-package/cypress.config.js"; | ||
import path from "path"; | ||
import { fileURLToPath } from "node:url"; | ||
|
||
const __filename = fileURLToPath(import.meta.url); | ||
const __dirname = path.dirname(__filename); | ||
|
||
cypressConfig.component.supportFile = path.join(__dirname, "cypress/support/component.ts"); | ||
|
||
export default cypressConfig; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import Button from "../../src/Button.js"; | ||
import ButtonState from "../../src/ButtonState.js"; | ||
|
||
describe("Initial rendering", () => { | ||
it("tests no config provided", () => { | ||
cy.mount( | ||
<Button> | ||
<ButtonState name="generate" text="Generate" icon="ai">Click me</ButtonState> | ||
<ButtonState name="generating" text="Stop Generating" icon="stop">Click me</ButtonState> | ||
<ButtonState name="revise" text="Revise" icon="ai">Click me</ButtonState> | ||
</Button> | ||
); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
import "../../../main/cypress/support/commands.js"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import "@ui5/webcomponents-tools/components-package/cypress/support/component.js"; | ||
|
||
import "./commands.js"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
{ | ||
"extends": "@ui5/webcomponents-tools/tsconfig.json", | ||
"include": [ | ||
"./**/*" | ||
], | ||
"compilerOptions": { | ||
"types": ["@ui5/webcomponents-tools"], | ||
"composite": true, | ||
"tsBuildInfoFile": "dist/.tsbuildinfobuild", | ||
"module": "NodeNext", | ||
"moduleResolution": "nodenext", | ||
"paths": { | ||
"@ui5/webcomponents-base/dist/*": [ | ||
"../../base/src/*" | ||
], | ||
"@ui5/webcomponents/dist/*": [ | ||
"../../main/src/*" | ||
], | ||
"@ui5/webcomponents-localization/dist/*": [ | ||
"../../localization/src/*" | ||
], | ||
"@ui5/webcomponents-theming/dist/*": [ | ||
"../../theming/src/*" | ||
], | ||
"@ui5/webcomponents-icons/dist/*": [ | ||
"../../icons/src/*" | ||
], | ||
"@ui5/webcomponents-icons-business-suite/dist/*": [ | ||
"../../icons-business-suite/src/*" | ||
], | ||
"@ui5/webcomponents-icons-tnt/dist/*": [ | ||
"../../icons-tnt/src/*" | ||
] | ||
}, | ||
}, | ||
"references": [ | ||
{ | ||
"path": "../" | ||
}, | ||
{ | ||
"path": "../../main/cypress" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.