Skip to content

Commit

Permalink
Fixed and Re-enabled tests
Browse files Browse the repository at this point in the history
  • Loading branch information
amartya4256 committed Dec 7, 2023
1 parent 8abe1b1 commit 3f28b7a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;

import java.util.List;
import java.util.stream.IntStream;

import org.eclipse.e4.ui.tests.css.core.util.ParserTestUtil;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.w3c.dom.css.CSSRuleList;
import org.w3c.dom.css.CSSStyleSheet;

/**
Expand All @@ -29,18 +30,23 @@
public class MediaRulesTest {

@Test
@Disabled("//THIS TEST KNOWN TO FAIL Dec 16/08")
void testMediaRule() throws Exception {
String css = """
@media screen, print {
BODY { line-height: 1.2 }
}
Label { background-color: #FF0000 }""";
@media screen, print {
BODY { line-height: 1.2 }
Label { background-color: #FFFFFF }
}
BODY { line-height: 1.3 }
Label { background-color: #FF0000 }""";
CSSStyleSheet styleSheet = ParserTestUtil.parseCss(css);
assertNotNull(styleSheet);
CSSRuleList rules = styleSheet.getCssRules();

List<String> cssRules = IntStream.range(0, styleSheet.getCssRules().getLength())
.mapToObj(i -> styleSheet.getCssRules().item(i).getCssText()).toList();

assertEquals(1, rules.getLength());
assertEquals(1, cssRules.stream().filter(it -> it.contains("line-height")).toList().size());
assertEquals(1, cssRules.stream().filter(it -> it.contains("background-color"))
.toList().size());
assert (cssRules.contains("background-color: #FFFFFF"));
assert (cssRules.contains("line-height: 1.3"));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,6 @@ void testSelectedShowClose2() {
}
}

@Disabled("test was commented before bug 443094")
@Test
void testClassSelectedShowClose() {
CTabFolder folder = createTestTabFolder();
Expand Down

0 comments on commit 3f28b7a

Please sign in to comment.