Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix govuk-colour deprecation message mismatch #3586

Merged
merged 1 commit into from
May 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions packages/govuk-frontend/src/govuk/helpers/_colour.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@
// Output a warning if $legacy is set to anything. This can't use the
// `_warning` mixin due to being a function, so we handle it manually.
@if $legacy and not index($govuk-suppressed-warnings, "legacy-colour-param") {
@warn "The `$legacy` parameter is deprecated and is non-operational. It " +
"will be removed in the next major version. To silence this warning, " +
"update $govuk-suppressed-warnings with key: \"legacy-palette\"";
@warn "The `$legacy` parameter of `govuk-colour` is deprecated and is " +
"non-operational. It will be removed in the next major version. To " +
"silence this warning, update $govuk-suppressed-warnings with key: " +
"\"legacy-colour-param\"";
}

@if type-of($colour) == "color" {
Expand Down
7 changes: 4 additions & 3 deletions packages/govuk-frontend/src/govuk/helpers/colour.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,10 @@ describe('@function govuk-colour', () => {
// argument, which should be the deprecation notice
expect(mockWarnFunction.mock.calls[0])
.toEqual(expect.arrayContaining([
'The `$legacy` parameter is deprecated and is non-operational. It ' +
'will be removed in the next major version. To silence this warning, ' +
'update $govuk-suppressed-warnings with key: "legacy-palette"'
'The `$legacy` parameter of `govuk-colour` is deprecated and is ' +
'non-operational. It will be removed in the next major version. To ' +
'silence this warning, update $govuk-suppressed-warnings with key: ' +
'"legacy-colour-param"'
]))
})
})
Expand Down