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 authored and fedejeanne committed Dec 8, 2023
1 parent 54e2bcd commit cbfc743
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 13 deletions.
3 changes: 2 additions & 1 deletion tests/org.eclipse.e4.ui.tests.css.core/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Export-Package: org.eclipse.e4.ui.tests.css.core;x-internal:=true,
Automatic-Module-Name: org.eclipse.e4.ui.tests.css.core
Import-Package: org.junit.jupiter.api,
org.junit.platform.suite.api,
org.w3c.css.sac;version="1.3.0"
org.w3c.css.sac;version="1.3.0",
org.assertj.core.api;version="3.24.2"
Bundle-Vendor: %Bundle-Vendor

Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@
******************************************************************************/
package org.eclipse.e4.ui.tests.css.core.parser;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.assertj.core.api.Assertions.assertThat;
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,22 @@
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());
assertThat(cssRules.stream().filter(it -> it.contains("background-color")).toList())
.containsOnly("Label { background-color: rgb(255, 0, 0); }");
assertThat(cssRules.stream().filter(it -> it.contains("line-height")).toList())
.containsOnly("BODY { 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 cbfc743

Please sign in to comment.