@use "true" as *;
@use "example" as *;
@use "../src/utils/one_liner";
@use "../src/utils/mode";

@include test-module("One Liner - ESR [mix]") {
  @include mode.ESR;

  @include test("content") {
    @include assert {
      @include output {
        @include one_liner.OneLinerContent {
          @include example;
        }
      }
      @include expect {
        @supports not -moz-bool-pref("userChrome.tabbar.one_liner.responsive") {
          @include example;
        }
        @supports -moz-bool-pref("userChrome.tabbar.one_liner.responsive") {
          @media screen and (min-width: 1100px) {
            @include example;
          }
        }
      }
    }
  }

  @include test("explicitly") {
    @include assert {
      @include output {
        @include one_liner.OneLiner {
          @include example;
        }
      }
      @include expect {
        @supports -moz-bool-pref("userChrome.tabbar.one_liner") {
          @supports not -moz-bool-pref("userChrome.tabbar.one_liner.responsive") {
            @include example;
          }
          @supports -moz-bool-pref("userChrome.tabbar.one_liner.responsive") {
            @media screen and (min-width: 1100px) {
              @include example;
            }
          }
        }
      }
    }
  }
}

@include test-module("One Liner - MediaPref [mix]") {
  @include mode.STANDARD;
  @include mode.MEDIA_BOOL_PREF;

  @include test("content") {
    @include assert {
      @include output {
        @include one_liner.OneLinerContent {
          @include example;
        }
      }
      @include expect {
        @media (not (-moz-bool-pref: '"userChrome.tabbar.one_liner.responsive"')) {
          @include example;
        }
        @media (-moz-bool-pref: '"userChrome.tabbar.one_liner.responsive"') {
          @media screen and (min-width: 1100px) {
            @include example;
          }
        }
      }
    }
  }

  @include test("explicitly") {
    @include assert {
      @include output {
        @include one_liner.OneLiner {
          @include example;
        }
      }
      @include expect {
        @media (-moz-bool-pref: '"userChrome.tabbar.one_liner"') and (not (-moz-bool-pref: '"userChrome.tabbar.one_liner.responsive"')) {
          @include example;
        }
        @media (-moz-bool-pref: '"userChrome.tabbar.one_liner"') {
          @media screen and (-moz-bool-pref: '"userChrome.tabbar.one_liner.responsive"') and (min-width: 1100px) {
            @include example;
          }
        }
      }
    }
  }
}

@include test-module("One Liner for Responsive - ESR [mix]") {
  @include mode.ESR;

  @include test("Tabs on bottom") {
    @include assert {
      @include output {
        @include one_liner.OneLinerOnBottom {
          @include example;
        }
      }
      @include expect {
        @supports not -moz-bool-pref("userChrome.tabbar.one_liner") {
          @include example;
        }
        @supports -moz-bool-pref("userChrome.tabbar.one_liner") {
          @supports -moz-bool-pref("userChrome.tabbar.one_liner.responsive") {
            @media screen and (max-width: 1100px) {
              @include example;
            }
          }
        }
      }
    }
  }

  @include test("Tab bar") {
    @include assert {
      @include output {
        @include one_liner.OneLinerTabbar {
          @include example;
        }
      }
      @include expect {
        @supports not -moz-bool-pref("userChrome.tabbar.one_liner.responsive") {
          @include example;
        }
        @supports -moz-bool-pref("userChrome.tabbar.one_liner.responsive") {
          @media screen and (min-width: 1100px) {
            @include example;
          }
          @supports -moz-bool-pref("userChrome.autohide.tabbar") {
            @include example;
          }
        }
      }
    }
  }

  @include test("Nav Bar") {
    @include assert {
      @include output {
        @include one_liner.OneLinerNavbar {
          @include example;
        }
      }
      @include expect {
        @supports -moz-bool-pref("userChrome.autohide.navbar") {
          @supports not -moz-bool-pref("userChrome.tabbar.one_liner") {
            @include example;
          }
          @supports -moz-bool-pref("userChrome.tabbar.one_liner") {
            @supports -moz-bool-pref("userChrome.tabbar.one_liner.responsive") {
              @media screen and (max-width: 1100px) {
                @include example;
              }
            }
          }
        }
      }
    }
  }
}

@include test-module("One Liner for Responsive - MEDIA_BOOL_PREF [mix]") {
  @include mode.STANDARD;
  @include mode.MEDIA_BOOL_PREF;

  @include test("Tabs on bottom") {
    @include assert {
      @include output {
        @include one_liner.OneLinerOnBottom {
          @include example;
        }
      }
      @include expect {
        @media (not (-moz-bool-pref: '"userChrome.tabbar.one_liner"')) {
          @include example;
        }
        @media screen and (-moz-bool-pref: '"userChrome.tabbar.one_liner"') and (-moz-bool-pref: '"userChrome.tabbar.one_liner.responsive"') and (max-width: 1100px) {
          @include example;
        }
      }
    }
  }

  @include test("Tab bar") {
    @include assert {
      @include output {
        @include one_liner.OneLinerTabbar {
          @include example;
        }
      }
      @include expect {
        @media (not (-moz-bool-pref: '"userChrome.tabbar.one_liner.responsive"')) {
          @include example;
        }
        @media screen and (-moz-bool-pref: '"userChrome.tabbar.one_liner.responsive"') and (min-width: 1100px) {
          @include example;
        }
        @media (-moz-bool-pref: '"userChrome.tabbar.one_liner.responsive"') and (-moz-bool-pref: '"userChrome.autohide.tabbar"') {
          @include example;
        }
      }
    }
  }

  @include test("Nav Bar") {
    @include assert {
      @include output {
        @include one_liner.OneLinerNavbar {
          @include example;
        }
      }
      @include expect {
        @media (-moz-bool-pref: '"userChrome.autohide.navbar"') and (not (-moz-bool-pref: '"userChrome.tabbar.one_liner"')) {
          @include example;
        }
        @media screen and (-moz-bool-pref: '"userChrome.autohide.navbar"') and (-moz-bool-pref: '"userChrome.tabbar.one_liner"') and (-moz-bool-pref: '"userChrome.tabbar.one_liner.responsive"') and (max-width: 1100px) {
          @include example;
        }
      }
    }
  }
}
