-
Notifications
You must be signed in to change notification settings - Fork 20
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 deprecation warnings when running tests #1899
Merged
Merged
Conversation
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
andysellick
force-pushed
the
fix-deprecation-warnings
branch
from
February 1, 2021 12:22
e403b63
to
c1bd687
Compare
alex-ju
approved these changes
Feb 1, 2021
- following the change to remove '.' from component render calls, specifically the /attachment/_thumbnail ... .svg files, the component auditing tests were failing because it was now detecting those files renamed from .svg to .html.erb as components and including them as things that should be included in the component audit results - modifying the code to remove the inclusion of the '/' character when detecting the component name fixes this problem, but raises the question why it was there in the first place, as all of our components should be in the top level dir and therefore never include a '/' character
andysellick
force-pushed
the
fix-deprecation-warnings
branch
from
February 15, 2021 08:35
c1bd687
to
23687fc
Compare
alex-ju
added a commit
that referenced
this pull request
Feb 15, 2021
## 24.1.1 * Fix deprecation warnings when running tests ([PR #1899](#1899)) * Update `govuk-frontend` base SCSS imports ([PR #1922](#1922)) * Remove redundant import in accordion component ([PR #1923](#1923)) * Fix toggle click tracking on step-by-steps ([PR #1925](#1925)) * Accordion summary design adjustment ([PR #1926](#1926)) * Fix `layout_header` layout and spacing issues ([PR #1924](#1924))
Merged
This was referenced Mar 11, 2021
Closed
Closed
Closed
Closed
Closed
This was referenced Mar 17, 2021
Closed
Closed
Closed
Closed
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What / why
Running the tests for the gem locally some deprecation warnings were being thrown up. They were:
action_view.raise_on_missing_translations
is deprecated.
in it is deprecatedThe first one was an easy fix, just swapping out the old for the new. The second one was a little more complicated. The attachment component has several partials that are
.svg
files but are rendered like partials. I renamed these files to.html.erb
and removed the file extension from therender
call, which removed the deprecation warning but suddenly caused one of the component audit tests to fail.This was because the formerly
.svg
files were now being recognised by the auditor as potential components that should be included when suggesting Sass/JS for applications, even though they were in a subdirectory for partials and not the main directory location for component templates. The fix for this was to amend the regex that matches this to remove the/
character when matching components. So if this was a template...Previously the auditor was identifying both lines as components, when only the first line is a true component. The question I'm left with is why the regex originally included the
/
character when matching... it seems a bit odd. I've checked it locally with collections and it seems to still produce the right suggested Sass/JS output, but perhaps some more thorough checking would be useful.I think this only really happened with components within components but I think one of the publishing apps might pull in a partial from the header component directly for some reason, I'm hoping someone can shed some light on this.
The specific deprecation warnings were:
Visual Changes
None.