Commit 8fe7b1ad authored by Scott Stern's avatar Scott Stern Committed by Natalia Tepluhina

Update Slot syntax and specs for header_cell

parent e6184680
...@@ -23,7 +23,7 @@ export default { ...@@ -23,7 +23,7 @@ export default {
<template> <template>
<cell class="license-header-cell" :is-flexible="false"> <cell class="license-header-cell" :is-flexible="false">
<template slot="title"> <template #title>
<gl-icon class="icon" :name="icon" /> <gl-icon class="icon" :name="icon" />
<span class="ml-2 font-weight-bold">{{ title }}</span> <span class="ml-2 font-weight-bold">{{ title }}</span>
</template> </template>
......
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`HeaderCell renders an inflexible cell with a title with an icon through props 1`] = `
<cell-stub
class="license-header-cell"
>
<template>
<gl-icon-stub
class="icon"
name="retry"
size="16"
/>
<span
class="ml-2 font-weight-bold"
>
title
</span>
</template>
</cell-stub>
`;
import { shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import { GlIcon } from '@gitlab/ui';
import Cell from 'ee/licenses/components/cells/cell.vue';
import { HeaderCell } from 'ee/licenses/components/cells'; import { HeaderCell } from 'ee/licenses/components/cells';
describe('HeaderCell', () => { describe('HeaderCell', () => {
...@@ -10,16 +12,26 @@ describe('HeaderCell', () => { ...@@ -10,16 +12,26 @@ describe('HeaderCell', () => {
title: 'title', title: 'title',
icon: 'retry', icon: 'retry',
}, },
stubs: {
Cell,
},
}); });
} }
beforeEach(() => {
createComponent();
});
afterEach(() => { afterEach(() => {
if (wrapper) wrapper.destroy(); if (wrapper) wrapper.destroy();
}); });
it('renders an inflexible cell with a title with an icon through props', () => { it('renders a cell with the correct "inflexible" value', () => {
createComponent(); expect(wrapper.find(Cell).props('isFlexible')).toBe(false);
});
expect(wrapper.element).toMatchSnapshot(); it('renders an icon and title', () => {
expect(wrapper.find(GlIcon).props('name')).toBe('retry');
expect(wrapper.find(Cell).text()).toContain('title');
}); });
}); });
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