Skip to content

Commit

Permalink
Fix Sass rounding in test assertions
Browse files Browse the repository at this point in the history
Dart Sass uses a higher 10dp precision
  • Loading branch information
colinrotherham committed Jan 16, 2023
1 parent 63d9e67 commit e60f29d
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/govuk/helpers/typography.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ describe('@mixin govuk-typography-responsive', () => {
.foo {
font-size: 14px;
font-size: 0.875rem;
line-height: 1.42857;
line-height: 1.4285714286;
}
}
`
Expand Down Expand Up @@ -309,14 +309,14 @@ describe('@mixin govuk-typography-responsive', () => {
${sassBootstrap}
.foo {
@include govuk-typography-responsive(3.14159265359)
@include govuk-typography-responsive(3.1415926536)
}
`

await expect(renderSassString(sass, sassConfig))
.rejects
.toThrow(
'Unknown font size `3.14159` - expected a point from the typography scale.'
'Unknown font size `3.1415926536` - expected a point from the typography scale.'
)
})

Expand All @@ -343,7 +343,7 @@ describe('@mixin govuk-typography-responsive', () => {
.foo {
font-size: 14px !important;
font-size: 0.875rem !important;
line-height: 1.42857 !important;
line-height: 1.4285714286 !important;
}
}
`
Expand Down Expand Up @@ -439,7 +439,7 @@ describe('@mixin govuk-typography-responsive', () => {
@media (min-width: 30em) {
.foo {
font-size: 14px;
line-height: 1.42857;
line-height: 1.4285714286;
}
}
`
Expand Down Expand Up @@ -468,7 +468,7 @@ describe('@mixin govuk-typography-responsive', () => {
@media (min-width: 30em) {
.foo {
font-size: 14px;
line-height: 1.42857;
line-height: 1.4285714286;
}
}
`
Expand Down Expand Up @@ -497,7 +497,7 @@ describe('@mixin govuk-typography-responsive', () => {
@media (min-width: 30em) {
.foo {
font-size: 14px !important;
line-height: 1.42857 !important;
line-height: 1.4285714286 !important;
}
}
`
Expand Down Expand Up @@ -547,7 +547,7 @@ describe('@mixin govuk-typography-responsive', () => {
@media (min-width: 30em) {
.foo {
font-size: 14px;
line-height: 1.42857;
line-height: 1.4285714286;
}
}
`
Expand Down Expand Up @@ -589,7 +589,7 @@ describe('@mixin govuk-typography-responsive', () => {
.foo {
font-size: 14px;
font-size: 0.875rem;
line-height: 1.42857;
line-height: 1.4285714286;
}
}
`
Expand Down

0 comments on commit e60f29d

Please sign in to comment.