Skip to content

Commit d7bd3cd

Browse files
test(css-helper): fix wildcard selector expectations
1 parent b180db2 commit d7bd3cd

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

packages/tests/css-helper.test.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,11 @@ describe("css-help", () => {
2121
});
2222
});
2323
describe("getStyle", () => {
24-
it("should return null for wildcard selector", () => {
25-
expect(t.getStyle("*")).toBeNull();
24+
it("should return a style for wildcard selector when explicitly requested", () => {
25+
expect(t.getStyle("*")).toBeTruthy();
26+
});
27+
it("should not implicitly match wildcard selector for non-wildcard selector", () => {
28+
expect(t.getStyle(".does-not-exist")).toBeNull();
2629
});
2730
it("should return a non-empty ExtendedCSSStyleDeclaration object", () => {
2831
expect(t.getStyle(".bb1")).toBeTruthy();
@@ -37,11 +40,9 @@ describe("css-help", () => {
3740
it("should return an ExtendedCSSStyleDeclaration object of length 1", () => {
3841
expect(t.getStyleAny([".earth", ".sky"])?.length).toEqual(1);
3942
});
40-
4143
it("should allow wildcard selector explicitly", () => {
4244
expect(t.getStyleAny(["*"])?.length).toEqual(1);
4345
});
44-
4546
it("should return null when no selectors match", () => {
4647
expect(t.getStyleAny([".sun", ".earth", ".moon"])).toBeNull();
4748
});

0 commit comments

Comments
 (0)