@use 'true' as test;
@use '../breakpoint';

@include test.describe('up mixin from breakpoint') {
    @include test.it('should output media query for provided breakpoint value') {
        @include test.assert() {
            @include test.output() {
                @include breakpoint.up(600px) {
                    .selector {
                        color: #bada55;
                    }
                }
            }

            @include test.expect() {
                @media (width >= 600px) {
                    .selector {
                        color: #bada55;
                    }
                }
            }
        }
    }

    @include test.it('should output styles directly without media query for 0 value') {
        @include test.assert() {
            @include test.output() {
                @include breakpoint.up(0) {
                    .selector {
                        color: #bada55;
                    }
                }
            }

            @include test.expect() {
                .selector {
                    color: #bada55;
                }
            }
        }
    }
}

@include test.describe('down mixin from breakpoint') {
    @include test.it('should output media query for provided breakpoint value') {
        @include test.assert() {
            @include test.output() {
                @include breakpoint.down(600px) {
                    .selector {
                        color: #bada55;
                    }
                }
            }

            @include test.expect() {
                @media (width < 600px) {
                    .selector {
                        color: #bada55;
                    }
                }
            }
        }
    }

    @include test.it('should output styles directly without media query for 0 value') {
        @include test.assert() {
            @include test.output() {
                @include breakpoint.down(0) {
                    .selector {
                        color: #bada55;
                    }
                }
            }

            @include test.expect() {
                .selector {
                    color: #bada55;
                }
            }
        }
    }
}

@include test.describe('get-modifier mixin') {
    @include test.it('should output empty string for a zero breakpoint value') {
        @include test.assert-equal(breakpoint.get-modifier('infix', 'mobile', 0), '');
    }

    @include test.it('should output an infix for a non-zero breakpoint value') {
        @include test.assert-equal(breakpoint.get-modifier('infix', 'tablet', 768px), 'tablet--');
    }

    @include test.it('should output a suffix for a non-zero breakpoint value') {
        @include test.assert-equal(breakpoint.get-modifier('suffix', 'tablet', 768px), '-tablet');
    }
}
