mirror of https://github.com/rancher/dashboard.git
29 lines
844 B
TypeScript
29 lines
844 B
TypeScript
import { mount } from '@vue/test-utils';
|
|
import SimpleBox from '@shell/components/SimpleBox.vue';
|
|
|
|
describe('component: SimpleBox.vue', () => {
|
|
const wrapper = mount(SimpleBox, { propsData: { title: 'Simple box title' } });
|
|
|
|
it('show title', () => {
|
|
const title = wrapper.find(`[data-testid="simple-box-title"]`);
|
|
|
|
expect(title.element).toBeDefined();
|
|
});
|
|
|
|
it('show close button', async() => {
|
|
await wrapper.setProps({ canClose: true });
|
|
const closeButton = wrapper.find(`[data-testid="simple-box-close"]`);
|
|
|
|
expect(closeButton.element).toBeDefined();
|
|
});
|
|
|
|
it('close emit', async() => {
|
|
await wrapper.setProps({ canClose: true });
|
|
const closeButton = wrapper.find(`[data-testid="simple-box-close"]`);
|
|
|
|
await closeButton.trigger('click');
|
|
|
|
expect(wrapper.emitted('close')).toBeTruthy();
|
|
});
|
|
});
|