Firefox-UI-Fix/__tests__/option.test.scss
2022-12-26 23:02:18 +09:00

152 lines
5.1 KiB
SCSS

@use "true" as *;
@use "example" as *;
@use "../src/utils/option";
@include test-module("If exist pref [mix]") {
@include test("simple") {
@include assert {
@include output {
@include option.Option("userChrome.tab.photon") {
@include example;
}
}
@include expect {
@supports -moz-bool-pref("userChrome.tab.photon") {
@include example;
}
}
}
}
@include test("multiple") {
@include assert {
@include output {
@include option.Option("userChrome.tab.photon", "userChrome.padding.photon") {
@include example;
}
}
@include expect {
@supports -moz-bool-pref("userChrome.tab.photon") or -moz-bool-pref("userChrome.padding.photon") {
@include example;
}
}
}
}
@include test("simple `and`") {
@include assert {
@include output {
@include option.Option("userChrome.tab.photon" "userChrome.padding.photon") {
@include example;
}
}
@include expect {
@supports (-moz-bool-pref("userChrome.tab.photon") and -moz-bool-pref("userChrome.padding.photon")) {
@include example;
}
}
}
}
@include test("multiple `and`") {
@include assert {
@include output {
@include option.Option("userChrome.tab.photon" "userChrome.padding.photon", "userChrome.tab.box_shadow") {
@include example;
}
@include option.Option("userChrome.tab.photon" "userChrome.padding.photon", "userChrome.tab.box_shadow", "userChrome.icon.panel_full") {
@include example;
}
@include option.Option("userChrome.tab.photon" "userChrome.padding.photon", "userChrome.tab.box_shadow" "userChrome.icon.panel_full") {
@include example;
}
}
@include expect {
@supports (-moz-bool-pref("userChrome.tab.photon") and -moz-bool-pref("userChrome.padding.photon")) or -moz-bool-pref("userChrome.tab.box_shadow") {
@include example;
}
@supports (-moz-bool-pref("userChrome.tab.photon") and -moz-bool-pref("userChrome.padding.photon")) or -moz-bool-pref("userChrome.tab.box_shadow") or -moz-bool-pref("userChrome.icon.panel_full") {
@include example;
}
@supports (-moz-bool-pref("userChrome.tab.photon") and -moz-bool-pref("userChrome.padding.photon")) or (-moz-bool-pref("userChrome.tab.box_shadow") and -moz-bool-pref("userChrome.icon.panel_full")) {
@include example;
}
}
}
}
}
@include test-module("If not exist pref [mx]") {
@include test("simple") {
@include assert {
@include output {
@include option.NotOption("userChrome.tab.photon") {
@include example;
}
}
@include expect {
@supports not -moz-bool-pref("userChrome.tab.photon") {
@include example;
}
}
}
}
@include test("multiple") {
@include assert {
@include output {
@include option.NotOption("userChrome.tab.photon", "userChrome.padding.photon") {
@include example;
}
}
@include expect {
@supports (not -moz-bool-pref("userChrome.tab.photon")) or (not -moz-bool-pref("userChrome.padding.photon")) {
@include example;
}
}
}
}
// @include test("simple `and`") {
// @include assert {
// @include output {
// @include option.NotOption("userChrome.tab.photon" "userChrome.padding.photon") {
// @include example;
// }
// }
// @include expect {
// // top level parens
// @supports ((not -moz-bool-pref("userChrome.tab.photon")) and (not -moz-bool-pref("userChrome.padding.photon"))) {
// @include example;
// }
// }
// }
// }
@include test("multiple `and`") {
@include assert {
@include output {
@include option.NotOption("userChrome.tab.photon" "userChrome.padding.photon", "userChrome.tab.box_shadow") {
@include example;
}
@include option.NotOption("userChrome.tab.photon" "userChrome.padding.photon", "userChrome.tab.box_shadow", "userChrome.icon.panel_full") {
@include example;
}
@include option.NotOption("userChrome.tab.photon" "userChrome.padding.photon", "userChrome.tab.box_shadow" "userChrome.icon.panel_full") {
@include example;
}
}
@include expect {
@supports ((not -moz-bool-pref("userChrome.tab.photon")) and (not -moz-bool-pref("userChrome.padding.photon"))) or (not -moz-bool-pref("userChrome.tab.box_shadow")) {
@include example;
}
@supports ((not -moz-bool-pref("userChrome.tab.photon")) and (not -moz-bool-pref("userChrome.padding.photon"))) or (not -moz-bool-pref("userChrome.tab.box_shadow")) or (not -moz-bool-pref("userChrome.icon.panel_full")) {
@include example;
}
@supports ((not -moz-bool-pref("userChrome.tab.photon")) and (not -moz-bool-pref("userChrome.padding.photon"))) or ((not -moz-bool-pref("userChrome.tab.box_shadow")) and (not -moz-bool-pref("userChrome.icon.panel_full"))) {
@include example;
}
}
}
}
}