Commit d2ebc02b authored by Olena Horal-Koretska's avatar Olena Horal-Koretska

Merge branch '335057-generic-report-format-issue-with-named-list' into 'master'

Display correct label for named-list report types

See merge request gitlab-org/gitlab!65507
parents 7c587fbd 648dc48a
......@@ -23,12 +23,12 @@ export default {
<div class="gl-display-table">
<ul v-if="hasItems" class="generic-report-named-list">
<li
v-for="{ label, ...values } in items"
v-for="{ label, name, ...values } in items"
:key="label"
class="generic-report-named-list-item"
data-testid="listItem"
>
<strong class="generic-report-named-list-label">{{ label }}</strong>
<strong class="generic-report-named-list-label">{{ name }}</strong>
<span class="generic-report-named-list-value">
<report-item :item="values" :data-testid="`listValue${label}`" />
</span>
......
......@@ -5,8 +5,8 @@ import { extendedWrapper } from 'helpers/vue_test_utils_helper';
const TEST_DATA = {
items: [
{ label: 'url1', type: REPORT_TYPES.url, href: 'http://foo.bar' },
{ label: 'url2', type: REPORT_TYPES.url, href: 'http://bar.baz' },
{ label: 'comment_1', name: 'url1', type: REPORT_TYPES.url, href: 'http://foo.bar' },
{ label: 'comment_2', name: 'url2', type: REPORT_TYPES.url, href: 'http://bar.baz' },
],
};
......@@ -47,8 +47,8 @@ describe('ee/vulnerabilities/components/generic_report/types/named_list.vue', ()
});
describe.each(TEST_DATA.items)('list item: %s', (item) => {
it(`renders the item's label`, () => {
expect(wrapper.findByText(item.label).exists()).toBe(true);
it(`renders the item's name`, () => {
expect(wrapper.findByText(item.name).exists()).toBe(true);
});
it('renders a report-item', () => {
......
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