// // Returns truthiness of a value // @include describe("[function] is-true") { @include it("should expect values to be truthy") { @include should(expect( flint-is-true(true)), to(be(true)) ); @include should(expect( flint-is-true("true")), to(be(true)) ); } @include it("should expect values to return false") { @include should(expect( flint-is-true(null)), to(be(false)) ); @include should(expect( flint-is-true(false)), to(be(false)) ); @include should(expect( flint-is-true(())), to(be(false)) ); @include should(expect( flint-is-true("")), to(be(false)) ); } } // // Checks if item is map // @include describe("[function] is-map") { $map: ("key": "value"); $list: ("one", "two", "three"); $string: "string"; $number: 1; $bool: true; $null: null; @include it("should expect variable to be a map and return true") { @include should(expect( flint-is-map($map)), to(be(true)) ); } @include it("should expect variable to be a map and return false") { @include should(expect( flint-is-map($list)), to(be(false)) ); @include should(expect( flint-is-map($string)), to(be(false)) ); @include should(expect( flint-is-map($number)), to(be(false)) ); @include should(expect( flint-is-map($bool)), to(be(false)) ); @include should(expect( flint-is-map($null)), to(be(false)) ); } } // // Checks if item is list // @include describe("[function] is-list") { $map: ("key": "value"); $list: ("one", "two", "three"); $string: "string"; $number: 1; $bool: true; $null: null; @include it("should expect variable to be a list and return true") { @include should(expect( flint-is-list($list)), to(be(true)) ); } @include it("should expect variable to be a list and return false") { @include should(expect( flint-is-list($map)), to(be(false)) ); @include should(expect( flint-is-list($string)), to(be(false)) ); @include should(expect( flint-is-list($number)), to(be(false)) ); @include should(expect( flint-is-list($bool)), to(be(false)) ); @include should(expect( flint-is-list($null)), to(be(false)) ); } } // // Checks if item is number // @include describe("[function] is-number") { $map: ("key": "value"); $list: ("one", "two", "three"); $string: "string"; $number: 1; $bool: true; $null: null; @include it("should expect variable to be a number and return true") { @include should(expect( flint-is-number($number)), to(be(true)) ); } @include it("should expect variable to be a number and return false") { @include should(expect( flint-is-number($map)), to(be(false)) ); @include should(expect( flint-is-number($list)), to(be(false)) ); @include should(expect( flint-is-number($string)), to(be(false)) ); @include should(expect( flint-is-number($bool)), to(be(false)) ); @include should(expect( flint-is-number($null)), to(be(false)) ); } } // // Checks if item is string // @include describe("[function] is-string") { $map: ("key": "value"); $list: ("one", "two", "three"); $string: "string"; $number: 1; $bool: true; $null: null; @include it("should expect variable to be a string and return true") { @include should(expect( flint-is-string($string)), to(be(true)) ); } @include it("should expect variable to be a string and return false") { @include should(expect( flint-is-string($map)), to(be(false)) ); @include should(expect( flint-is-string($list)), to(be(false)) ); @include should(expect( flint-is-string($number)), to(be(false)) ); @include should(expect( flint-is-string($bool)), to(be(false)) ); @include should(expect( flint-is-string($null)), to(be(false)) ); } } // // Checks if item is not string // @include describe("[function] is-not-string") { $map: ("key": "value"); $list: ("one", "two", "three"); $string: "string"; $number: 1; $bool: true; $null: null; @include it("should expect variable not to be a string") { @include should(expect( flint-is-not-string($string)), not-to(be(true)) ); @include should(expect( flint-is-not-string($map)), to(be(true)) ); @include should(expect( flint-is-not-string($list)), to(be(true)) ); @include should(expect( flint-is-not-string($number)), to(be(true)) ); @include should(expect( flint-is-not-string($bool)), to(be(true)) ); @include should(expect( flint-is-not-string($null)), to(be(true)) ); } } // // Get gutter value from config map // @include describe("[function] get-gutter") { @include it("should expect gutter value from config") { @include should(expect( flint-get-gutter()), to(be((0.625em))) ); } } // // Gets list of each breakpoint's key // @include describe("[function] get-all-keys") { @include it("should expect a list of all breakpoint keys") { @include should(expect( flint-get-all-keys()), to(be(("desktop", "laptop", "tablet", "mobile"))) ); } } // // Gets list of all breakpoints // @include describe("[function] get-all-breakpoints") { @include it("should expect a list of all breakpoint values") { @include should(expect( flint-get-all-breakpoints()), to(be((80em, 60em, 40em, 20em))) ); } } // // Checks if passed $key is the highest breakpoint // @include describe("[function] is-highest-breakpoint") { @include it("should expect to be highest breakpoint") { @include should(expect( flint-is-highest-breakpoint("desktop")), to(be(true)) ); } @include it("should expect not to be highest breakpoint") { @include should(expect( flint-is-highest-breakpoint("laptop")), to(be(false)) ); @include should(expect( flint-is-highest-breakpoint("tablet")), to(be(false)) ); @include should(expect( flint-is-highest-breakpoint("mobile")), to(be(false)) ); } } // // Checks if passed $key is the lowest breakpoint // @include describe("[function] is-lowest-breakpoint") { @include it("should expect to be lowest breakpoint") { @include should(expect( flint-is-lowest-breakpoint("mobile")), to(be(true)) ); } @include it("should expect not to be lowest breakpoint") { @include should(expect( flint-is-lowest-breakpoint("desktop")), to(be(false)) ); @include should(expect( flint-is-lowest-breakpoint("laptop")), to(be(false)) ); @include should(expect( flint-is-lowest-breakpoint("tablet")), to(be(false)) ); } } // // Checks if $key is grid default // @include describe("[function] is-default") { @include it("should expect to be default breakpoint") { @include should(expect( flint-is-default("mobile")), to(be(true)) ); } @include it("should expect not to be default breakpoint") { @include should(expect( flint-is-default("desktop")), to(be(false)) ); @include should(expect( flint-is-default("laptop")), to(be(false)) ); @include should(expect( flint-is-default("tablet")), to(be(false)) ); } } // // Gets all breakpoint column values // @include describe("[function] get-all-columns") { @include it("should expect a list of all breakpoint column values") { @include should(expect( flint-get-all-columns()), to(be((16, 12, 8, 4))) ); } } // // Returns the unit used in config // @include describe("[function] get-config-unit") { @include it("should expect configuration unit to be ems") { @include should(expect( flint-get-config-unit()), to(be("em")) ); } } // // Convert pixel value to em // @include describe("[function] to-em") { @include it("should expect passed pixel value to be converted to ems") { @include should(expect( flint-to-em(16px)), to(be(1em)) ); @include should(expect( flint-to-em(32px)), to(be(2em)) ); @include should(expect( flint-to-em(16px, 32px)), to(be(0.5em)) ); } } // // Convert pixel value to rem // @include describe("[function] to-rem") { @include it("should expect passed pixel value to be converted to rems") { @include should(expect( flint-to-rem(16px)), to(be(1rem)) ); @include should(expect( flint-to-rem(32px)), to(be(2rem)) ); @include should(expect( flint-to-rem(16px, 32px)), to(be(0.5rem)) ); } }