Commit 82d96269 authored by Scott Hampton's avatar Scott Hampton

Adjust tests to check render

Instead of testing computed props directly,
we'll test the rendered result so that the tests
aren't brittle when refactors occur.
parent ccf2e0a2
...@@ -41,7 +41,7 @@ export default { ...@@ -41,7 +41,7 @@ export default {
{{ __('New') }} {{ __('New') }}
</div> </div>
{{ issue.name }} {{ issue.name }}
<a :href="learnMoreUrl">{{ __('Learn More') }}</a> <a ref="accessibility-issue-learn-more" :href="learnMoreUrl">{{ __('Learn More') }}</a>
{{ __('Message: ') }} {{ __('Message: ') }}
{{ issue.message }} {{ issue.message }}
</div> </div>
......
...@@ -7,7 +7,6 @@ const issue = { ...@@ -7,7 +7,6 @@ const issue = {
code: 'WCAG2AA.Principle4.Guideline4_1.4_1_2.H91.A.NoContent', code: 'WCAG2AA.Principle4.Guideline4_1.4_1_2.H91.A.NoContent',
status: 'failed', status: 'failed',
className: 'spec.test_spec', className: 'spec.test_spec',
parsedTECHSCode: 'H91',
learnMoreUrl: 'https://www.w3.org/TR/WCAG20-TECHS/H91.html', learnMoreUrl: 'https://www.w3.org/TR/WCAG20-TECHS/H91.html',
}; };
...@@ -39,12 +38,9 @@ describe('CustomMetricsForm', () => { ...@@ -39,12 +38,9 @@ describe('CustomMetricsForm', () => {
wrapper.destroy(); wrapper.destroy();
}); });
it('Parses the TECHS Code from the issue code correctly', () => {
expect(wrapper.vm.parsedTECHSCode).toEqual(issue.parsedTECHSCode);
});
it('Creates the correct URL for learning more about the issue code', () => { it('Creates the correct URL for learning more about the issue code', () => {
expect(wrapper.vm.learnMoreUrl).toEqual(issue.learnMoreUrl); const learnMoreUrl = wrapper.find({ ref: 'accessibility-issue-learn-more' }).attributes('href');
expect(learnMoreUrl).toEqual(issue.learnMoreUrl);
}); });
describe('When issue is new', () => { describe('When issue is new', () => {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment