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 {
{{ __('New') }}
</div>
{{ issue.name }}
<a :href="learnMoreUrl">{{ __('Learn More') }}</a>
<a ref="accessibility-issue-learn-more" :href="learnMoreUrl">{{ __('Learn More') }}</a>
{{ __('Message: ') }}
{{ issue.message }}
</div>
......
......@@ -7,7 +7,6 @@ const issue = {
code: 'WCAG2AA.Principle4.Guideline4_1.4_1_2.H91.A.NoContent',
status: 'failed',
className: 'spec.test_spec',
parsedTECHSCode: 'H91',
learnMoreUrl: 'https://www.w3.org/TR/WCAG20-TECHS/H91.html',
};
......@@ -39,12 +38,9 @@ describe('CustomMetricsForm', () => {
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', () => {
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', () => {
......
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