Skip to content

Commit

Permalink
Fix auditing tests
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
andysellick committed Feb 1, 2021
1 parent d1cafe6 commit e403b63
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def initialize(path, name)
stylesheets = Dir["#{path}/app/assets/stylesheets/**/*.scss"]
javascripts = Dir["#{path}/app/assets/javascripts/**/*.js"]

find_components = /(?<=govuk_publishing_components\/components\/)[\/a-zA-Z_-]+(?=['"])/
find_components = /(?<=govuk_publishing_components\/components\/)[a-zA-Z_-]+(?=['"])/

@find_all_stylesheets = /@import ["']{1}govuk_publishing_components\/all_components/
find_stylesheets = /(?<=@import ["']{1}govuk_publishing_components\/components\/)(?!print\/)+[a-zA-Z_-]+(?=['"])/
Expand Down

0 comments on commit e403b63

Please sign in to comment.