Skip to content

Commit de3b900

Browse files
committed
Simplify test selectors
1 parent a7c38ff commit de3b900

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

integration/vite-css-lazy-loading-test.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,14 @@ import {
1010
js,
1111
} from "./helpers/create-fixture.js";
1212

13-
const CSS_LINK_SELECTOR = "link[rel='stylesheet']";
14-
const CSS_COMPONENT_LINK_SELECTOR = `${CSS_LINK_SELECTOR}[href*='css-component']`;
1513
// Link hrefs with a trailing hash are only ever managed by React Router, to
1614
// ensure they're forcibly unique from the Vite-injected links
17-
const ANY_FORCIBLY_UNIQUE_CSS_LINK_SELECTOR = `${CSS_LINK_SELECTOR}[href$='#']`;
18-
const CSS_COMPONENT_FORCIBLY_UNIQUE_LINK_SELECTOR = `${CSS_COMPONENT_LINK_SELECTOR}[href$='#']`;
15+
const FORCIBLY_UNIQUE_HREF_SELECTOR = "[href$='#']";
16+
const CSS_LINK_SELECTOR = "link[rel='stylesheet']";
17+
const ANY_FORCIBLY_UNIQUE_CSS_LINK_SELECTOR = `link[rel='stylesheet']${FORCIBLY_UNIQUE_HREF_SELECTOR}`;
18+
const CSS_COMPONENT_LINK_SELECTOR =
19+
"link[rel='stylesheet'][href*='css-component']";
20+
const CSS_COMPONENT_FORCIBLY_UNIQUE_LINK_SELECTOR = `link[rel='stylesheet'][href*='css-component']${FORCIBLY_UNIQUE_HREF_SELECTOR}`;
1921

2022
function getColor(page: Page, selector: string) {
2123
return page

0 commit comments

Comments
 (0)