Commit bd236a7e authored by samdbeckham's avatar samdbeckham

Adds changes from @kushalpandya s review

- use v-show in place of v-if for dismissed states
- wrap custom class name in quotes
- adds tests for the changes
parent 0c71fe19
......@@ -59,7 +59,7 @@ export default {
<template>
<div
class="gl-responsive-table-row vulnerabilities-row"
:class="{ dismissed: isDismissed }"
:class="{ 'dismissed': isDismissed }"
>
<div class="table-section section-10">
<div
......@@ -93,7 +93,7 @@ export default {
@click="openModal({ vulnerability })"
>{{ vulnerability.name }}</gl-button>
<span
v-if="isDismissed"
v-show="isDismissed"
class="prepend-left-8 vertical-align-middle"
>DISMISSED</span>
<vulnerability-issue-link
......
......@@ -87,4 +87,25 @@ describe('Security Dashboard Table Row', () => {
});
});
});
describe('with a dismissed vulnerability', () => {
const vulnerability = mockDataVulnerabilities[2];
beforeEach(() => {
props = { vulnerability };
vm = mountComponentWithStore(Component, { store, props });
});
afterEach(() => {
vm.$destroy();
});
it('should have a `dismissed` class', () => {
expect(vm.$el.classList).toContain('dismissed');
});
it('should render a `DISMISSED` tag', () => {
expect(vm.$el.textContent).toContain('DISMISSED');
});
});
});
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