This repository has been archived by the owner on Jul 14, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 425
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add basic test coverage for grid-media
- Loading branch information
Showing
2 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
@import "setup"; | ||
|
||
$medium-screen: 1000px; | ||
|
||
$custom-neat-grid: ( | ||
columns: 12, | ||
gutter: 50px, | ||
media: $medium-screen, | ||
); | ||
|
||
$specific-neat-grid: ( | ||
columns: 12, | ||
gutter: 80px, | ||
media: "only screen and (min-width: 1000px) and (max-width: 1100px)", | ||
); | ||
|
||
$print-neat-grid: ( | ||
columns: 10, | ||
gutter: 20px, | ||
media: print, | ||
); | ||
|
||
.grid-column-media-custom-neat-grid { | ||
@include grid-media($custom-neat-grid) { | ||
@include grid-column(3); | ||
} | ||
} | ||
|
||
.grid-column-media-specific-neat-grid { | ||
@include grid-media($specific-neat-grid) { | ||
@include grid-column(6); | ||
} | ||
} | ||
|
||
.grid-column-media-print-neat-grid { | ||
@include grid-media($print-neat-grid) { | ||
@include grid-column(8); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
require "spec_helper" | ||
|
||
describe "@include grid-media() {...}" do | ||
before(:all) do | ||
ParserSupport.parse_file("mixins/grid-media") | ||
end | ||
|
||
context "with argument ($custom-neat-grid)" do | ||
it "outputs @media only screen and (min-width: 1000px)" do | ||
expect(".grid-column-media-custom-neat-grid").to be_contained_in("only screen and (min-width: 1000px)") | ||
end | ||
end | ||
|
||
context "with argument ($specific-neat-grid)" do | ||
it "outputs @media only screen and (min-width: 1000px) and (max-width: 1100px)" do | ||
expect(".grid-column-media-specific-neat-grid").to be_contained_in("only screen and (min-width: 1000px) and (max-width: 1100px)") | ||
end | ||
end | ||
|
||
context "with argument ($print-neat-grid)" do | ||
it "outputs @media print" do | ||
expect(".grid-column-media-print-neat-grid").to be_contained_in("print") | ||
end | ||
end | ||
end |