UNPKG

2.48 kBSCSSView Raw
1// _config.scss unit tests
2@use '../test_base' as *;
3@use '../../src/internal/config';
4
5/***********************
6 * get-viewport-flag-internal() *
7 ***********************/
8@include describe('get-viewport-flag-internal()') {
9 @include it('should return if flag is enabled or not given valid flag "OPACITY"') {
10 @include assert-equal(
11 config.get-viewport-flag-internal(
12 (
13 $OPACITY: false,
14 ),
15 $OPACITY
16 ),
17 false
18 );
19 }
20 @include it('should throw an error if the given flag is invalid') {
21 @include assert-equal(
22 config.get-viewport-flag('UNKNOWN'),
23 build-true-error-string('get-viewport-flag()', '[get-viewport-flag] Unknown constant `UNKNOWN`.')
24 );
25 }
26}
27
28/************************************
29 * should-generate-classes-internal() *
30 ************************************/
31@include describe('should-generate-classes-internal()') {
32 @include it('should return true if includes: () and excludes: () for flag: OPACITY"') {
33 @include assert-equal(config.should-generate-classes-internal((), (), $OPACITY), true);
34 }
35 @include it('should return false if includes: () and excludes: (ALL) for flag: OPACITY') {
36 @include assert-equal(config.should-generate-classes-internal((), ($ALL), $OPACITY), false);
37 }
38 @include it('should return false if includes: () and excludes: (OPACITY) for flag: OPACITY') {
39 @include assert-equal(config.should-generate-classes-internal((), ($OPACITY), $OPACITY), false);
40 }
41 @include it('should return true if includes: (OPACITY) and excludes: (OPACITY) for flag: OPACITY') {
42 @include assert-equal(config.should-generate-classes-internal(($OPACITY), ($OPACITY), $OPACITY), true);
43 }
44 @include it('should return false if includes: () and excludes: () for unknown flag: TEST') {
45 @include assert-equal(config.should-generate-classes-internal((), (), TEST), true);
46 }
47 @include it('should return false if includes: ($ALL) and excludes: () for flag: OPACITY') {
48 @include assert-equal(config.should-generate-classes-internal(($ALL), (), $OPACITY), true);
49 }
50 @include it('should return false if includes: (\'ALL\') and excludes: () for flag: OPACITY') {
51 @include assert-equal(config.should-generate-classes-internal(('ALL'), (), $OPACITY), true);
52 }
53}