Add tests

This commit is contained in:
cnotv 2025-03-06 17:28:09 +01:00
parent 7d16a8ed1f
commit 6881f21bc1
1 changed files with 31 additions and 0 deletions

View File

@ -0,0 +1,31 @@
import { mount, type VueWrapper } from '@vue/test-utils';
import MembershipEditor from '@shell/components/form/Members/MembershipEditor.vue';
describe('component: MembershipEditor', () => {
let wrapper: VueWrapper<any, any>;
beforeEach(() => {
wrapper = mount(MembershipEditor, {
props: {
addMemberDialogName: 'addMemberDialogName',
parentKey: 'parentKey',
mode: 'edit',
type: 'no idea',
},
global: {
mocks: {
$store: { getters: { 'rancher/schemaFor': () => ({ type: 'object' }) } },
$fetchState: { pending: false },
}
}
});
});
it('should render the component', () => {
expect(wrapper.exists()).toBe(true);
});
it('should remove the correct member', () => {
expect(wrapper.vm.members).toStrictEqual([]);
});
});