-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(e2e-development-runtime): add test cases for various edge cases …
…related to css HMR
- Loading branch information
Showing
6 changed files
with
210 additions
and
13 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
3 changes: 3 additions & 0 deletions
3
...ts/development-runtime/src/pages/styling/not-visited-plain-css-not-imported-initially.css
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 @@ | ||
.not-visited-plain-css-not-imported-initially { | ||
color: red; | ||
} |
3 changes: 3 additions & 0 deletions
3
e2e-tests/development-runtime/src/pages/styling/not-visited-plain-css.css
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 @@ | ||
.not-visited-plain-css-test { | ||
color: red; | ||
} |
17 changes: 17 additions & 0 deletions
17
e2e-tests/development-runtime/src/pages/styling/not-visited-plain-css.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,17 @@ | ||
import * as React from "react" | ||
|
||
import "./not-visited-plain-css.css" | ||
// UNCOMMENT-IN-TEST import "./not-visited-plain-css-not-imported-initially.css" | ||
|
||
export default function PlainCss() { | ||
return ( | ||
<> | ||
<p> | ||
This content doesn't matter - we never visit this page in tests - but | ||
because we generate single global .css file, we want to test changing | ||
css files imported by this module (and also adding new css imports).css | ||
</p> | ||
<p>css imported by this template is tested in `./plain-css.js` page</p> | ||
</> | ||
) | ||
} |
3 changes: 3 additions & 0 deletions
3
e2e-tests/development-runtime/src/pages/styling/plain-css-not-imported-initially.css
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 @@ | ||
.plain-css-not-imported-initially { | ||
color: red; | ||
} |
25 changes: 23 additions & 2 deletions
25
e2e-tests/development-runtime/src/pages/styling/plain-css.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 |
---|---|---|
@@ -1,11 +1,32 @@ | ||
import * as React from "react" | ||
|
||
import "./plain-css.css" | ||
// UNCOMMENT-IN-TEST import "./plain-css-not-imported-initially.css" | ||
|
||
export default function PlainCss() { | ||
return ( | ||
<div data-testid="styled-element" className="plain-css-test"> | ||
test | ||
<div style={{ color: `black` }}> | ||
<div data-testid="styled-element" className="plain-css-test"> | ||
test | ||
</div> | ||
<div | ||
data-testid="styled-element-that-is-not-styled-initially" | ||
className="plain-css-not-imported-initially" | ||
> | ||
test | ||
</div> | ||
<div | ||
data-testid="styled-element-by-not-visited-template" | ||
className="not-visited-plain-css-test" | ||
> | ||
test | ||
</div> | ||
<div | ||
data-testid="styled-element-that-is-not-styled-initially-by-not-visited-template" | ||
className="not-visited-plain-css-not-imported-initially " | ||
> | ||
test | ||
</div> | ||
</div> | ||
) | ||
} |