@@ -21,12 +21,11 @@ describe("css-help", () => {
2121 } ) ;
2222 } ) ;
2323 describe ( "getStyle" , ( ) => {
24- it ( "should return null for wildcard selectors " , ( ) => {
25- expect ( t . getStyle ( "*" ) ) . toBeNull ( ) ;
24+ it ( "should return a style for wildcard selector when present " , ( ) => {
25+ expect ( t . getStyle ( "*" ) ) . toBeTruthy ( ) ;
2626 } ) ;
27-
28- it ( "should return null for compound wildcard selectors" , ( ) => {
29- expect ( t . getStyle ( "div > * > span" ) ) . toBeNull ( ) ;
27+ it ( "should return null for selector not present in CSS" , ( ) => {
28+ expect ( t . getStyle ( ".this-selector-does-not-exist" ) ) . toBeNull ( ) ;
3029 } ) ;
3130 it ( "should return a non-empty ExtendedCSSStyleDeclaration object" , ( ) => {
3231 expect ( t . getStyle ( ".bb1" ) ) . toBeTruthy ( ) ;
@@ -42,9 +41,9 @@ describe("css-help", () => {
4241 expect ( t . getStyleAny ( [ ".earth" , ".sky" ] ) ?. length ) . toEqual ( 1 ) ;
4342 } ) ;
4443 it ( "should return null when none of the selectors match" , ( ) => {
45- expect ( t . getStyleAny ( [ ".sun" , ".earth" , ". moon"] ) ) . toBeNull ( ) ;
44+ expect ( t . getStyleAny ( [ ".sun" , ".moon" ] ) ) . toBeNull ( ) ;
4645 } ) ;
47- it ( "should ignore wildcard selectors inside getStyleAny " , ( ) => {
46+ it ( "should return style even if wildcard selector is present in the list " , ( ) => {
4847 expect ( t . getStyleAny ( [ "*" , ".bb1" ] ) ) . toBeTruthy ( ) ;
4948 } ) ;
5049 } ) ;
0 commit comments