Skip to content
代码片段 群组 项目
提交 88b7d5dd 编辑于 作者: Miguel Rincon's avatar Miguel Rincon 提交者: David Dieulivol
浏览文件

Remove Danger warnings for changes in tests

This change removes `data-testid` warnings when tests have changed.

The warnings are meant to prevent breakage when production code changes
and the tests have not yet passed, not the other way around.
上级 29319e26
No related branches found
No related tags found
无相关合并请求
...@@ -2,13 +2,15 @@ ...@@ -2,13 +2,15 @@
return if helper.stable_branch? return if helper.stable_branch?
data_testids = /testid|data-testid|find_by_testid|within_testid/ data_testids = /testid/
deprecated_qa_selectors = /(?=qa_selector|data-qa-selector)|(?!.*\bdata-qa-)(?=class=.*qa-.*|class: .*qa-.*)/ deprecated_qa_selectors = /(?=qa_selector|data-qa-selector)|(?!.*\bdata-qa-)(?=class=.*qa-.*|class: .*qa-.*)/
def filter_changed_lines(files, pattern) def filter_changed_lines(files, pattern)
lines = [] lines = []
files.each do |file| files.each do |file|
next if file.start_with?('spec/', 'ee/spec/', 'qa/')
testid_changed_lines = helper.changed_lines(file).select { |line| line =~ pattern } testid_changed_lines = helper.changed_lines(file).select { |line| line =~ pattern }
next unless testid_changed_lines.any? next unless testid_changed_lines.any?
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册