Skip to content

Commit 8ea0248

Browse files
committed
fix: fix template for shadowdom and cssmodule
1 parent 726a9d9 commit 8ea0248

File tree

15 files changed

+43
-12
lines changed

15 files changed

+43
-12
lines changed

app-min/cypress__if_cypress/integration/app.e2e.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
context('The app', () => {
44
it('shows message', () => {
55
cy.visit('/');
6-
cy.get('app>div').contains('Hello World!');
6+
// @if shadow-dom-open || shadow-dom-closed
7+
cy.shadowGet('my-app').shadowFind('div').shadowContains('Hello World!');
8+
// @endif
9+
// @if !shadow-dom-open && !shadow-dom-closed
10+
cy.get('my-app>div').contains('Hello World!');
11+
// @endif
712
});
813
});

app-min/src/app.html

Lines changed: 0 additions & 3 deletions
This file was deleted.

app-min/src/my-app.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.message {
2+
background-color: lightblue;
3+
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
export class App {
1+
export class MyApp {
22
message = 'Hello World!';
33
}

app-min/src/my-app.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<template>
2+
<div class="message">${message}</div>
3+
</template>

browserify/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
</head>
1010

1111
<body>
12-
<app></app>
12+
<my-app></my-app>
1313
<script src="/dist/bundle.js"></script>
1414
</body>
1515

cypress/cypress/support/commands.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,7 @@
2323
//
2424
// -- This is will overwrite an existing command --
2525
// Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... })
26+
27+
// @if shadow-dom-open || shadow-dom-closed
28+
import 'cypress-shadow-dom';
29+
// @endif

cypress/package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
"devDependencies": {
33
"cypress": "^3.0.0",
44
"babel-eslint": "^10.0.0",
5-
"eslint": "^6.0.0"
5+
"eslint": "^6.0.0",
6+
// @if shadow-dom-open || shadow-dom-closed
7+
"cypress-shadow-dom": "^1.0.0",
8+
// @endif
69
},
710
"scripts": {
811
"test:e2e": "cypress run"

dumber/_index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
</head>
1010

1111
<body>
12-
<app></app>
12+
<my-app></my-app>
1313
<script src="/dist/entry-bundle.js" data-main="main"></script>
1414
</body>
1515

e2e-test.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,15 +80,23 @@ async function takeScreenshot(url, filePath) {
8080

8181
const skeletons = [
8282
'webpack babel app-min cypress',
83+
'webpack babel shadow-dom-open app-min cypress',
84+
'webpack babel css-module app-min cypress',
8385
'webpack typescript app-min cypress',
86+
'webpack typescript shadow-dom-closed app-min cypress',
87+
'webpack typescript css-module app-min cypress',
8488
// 'parcel babel app-min cypress',
8589
// 'parcel typescript app-min cypress',
8690
// 'browserify babel app-min cypress',
8791
// 'browserify typescript app-min cypress',
8892
// 'fuse-box babel app-min cypress',
8993
// 'fuse-box typescript app-min cypress',
9094
'dumber babel app-min cypress',
91-
'dumber typescript app-min cypress'
95+
'dumber babel shadow-dom-closed app-min cypress',
96+
'dumber babel css-module app-min cypress',
97+
'dumber typescript app-min cypress',
98+
'dumber typescript shadow-dom-open app-min cypress',
99+
'dumber typescript css-module app-min cypress'
92100
];
93101

94102
function getServerRegex(features) {

0 commit comments

Comments
 (0)