From af38cf5f3ea3ce927fe8266314182ed580241509 Mon Sep 17 00:00:00 2001 From: SBats Date: Sun, 5 Mar 2017 12:11:55 -0500 Subject: [PATCH] Create css combnators tests page in apps Setup direct siblings apps tests Fix direct child test Add direct sibling test on class and type element Add sibling combinator handling for id selectors Completely redo sibling selector and add attributes and pseudo class selectors tests Handle sibling via a custom group instead of a selector Fix Selector groups creation Add unit test for sibling selection Fix tslint errors --- apps/app/ui-tests-app/css/combinators.css | 36 ++++++++++ apps/app/ui-tests-app/css/combinators.xml | 66 ++++++++++++++++++ apps/app/ui-tests-app/css/main-page.ts | 1 + tests/app/ui/styling/css-selector.ts | 35 ++++++++++ .../ui/styling/css-selector/css-selector.d.ts | 2 + .../ui/styling/css-selector/css-selector.ts | 67 ++++++++++++++----- 6 files changed, 191 insertions(+), 16 deletions(-) create mode 100644 apps/app/ui-tests-app/css/combinators.css create mode 100644 apps/app/ui-tests-app/css/combinators.xml diff --git a/apps/app/ui-tests-app/css/combinators.css b/apps/app/ui-tests-app/css/combinators.css new file mode 100644 index 000000000..a1beb6d33 --- /dev/null +++ b/apps/app/ui-tests-app/css/combinators.css @@ -0,0 +1,36 @@ +.direct-child--type > Button { + background-color: red; + color: white; +} + +.direct-child--class > .test-child { + background-color: blue; + color: white; +} + +.direct-sibling--type Button + Label { + background-color: green; + color: white; +} + +.direct-sibling--id #test-child + #test-child-2 { + background-color: pink; +} + +.direct-sibling--class .test-child + .test-child-2 { + background-color: yellow; +} + +.direct-sibling--attribute Button[data="test-child"] + Button[data="test-child-2"] { + background-color: blueviolet; + color: white; +} + +.direct-sibling--pseudo-selector Button + Button:disabled { + background-color: black; + color: white; +} + +.sibling-test-label { + text-align: center; +} diff --git a/apps/app/ui-tests-app/css/combinators.xml b/apps/app/ui-tests-app/css/combinators.xml new file mode 100644 index 000000000..b7ee5b367 --- /dev/null +++ b/apps/app/ui-tests-app/css/combinators.xml @@ -0,0 +1,66 @@ + + + + + +