-
Notifications
You must be signed in to change notification settings - Fork 328
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test output of
@mixin govuk-width-container
- Loading branch information
1 parent
08e41ec
commit dd95356
Showing
1 changed file
with
48 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,48 @@ | ||
/* eslint-env jest */ | ||
|
||
const outdent = require('outdent') | ||
|
||
const { renderSass } = require('../../../lib/jest-helpers') | ||
|
||
const sassConfig = { | ||
outputStyle: 'nested' | ||
} | ||
|
||
describe('@mixin govuk-width-container', () => { | ||
it('allows different widths to be specified using $width', async () => { | ||
const sass = ` | ||
@import "objects/width-container"; | ||
.app-width-container--wide { | ||
@include govuk-width-container(1200); | ||
} | ||
` | ||
const results = await renderSass({ data: sass, ...sassConfig }) | ||
|
||
expect(results.css | ||
.toString() | ||
.trim()) | ||
.toContain(outdent` | ||
.app-width-container--wide { | ||
max-width: 1200px; | ||
margin: 0 15px; } | ||
@supports (margin: max(calc(0px))) { | ||
.app-width-container--wide { | ||
margin-right: max(15px, calc(15px + env(safe-area-inset-right))); | ||
margin-left: max(15px, calc(15px + env(safe-area-inset-left))); } } | ||
@media (min-width: 40.0625em) { | ||
.app-width-container--wide { | ||
margin: 0 30px; } | ||
@supports (margin: max(calc(0px))) { | ||
.app-width-container--wide { | ||
margin-right: max(30px, calc(15px + env(safe-area-inset-right))); | ||
margin-left: max(30px, calc(15px + env(safe-area-inset-left))); } } } | ||
@media (min-width: 1260px) { | ||
.app-width-container--wide { | ||
margin: 0 auto; } | ||
@supports (margin: max(calc(0px))) { | ||
.app-width-container--wide { | ||
margin: 0 auto; } } } | ||
`) | ||
}) | ||
}) |