|
|
@@ -3,6 +3,7 @@ import {useDataUtils} from "~/composables/data/useDataUtils";
|
|
|
import {Organization} from "~/models/Organization/Organization";
|
|
|
import {Ref, ref} from "@nuxtjs/composition-api";
|
|
|
import {mountComposition} from "~/tests/unit/Helpers";
|
|
|
+import {useForm} from "~/composables/form/useForm";
|
|
|
jest.mock('~/services/data/dataProvider')
|
|
|
|
|
|
|
|
|
@@ -23,8 +24,9 @@ describe('getItemToEdit()', () => {
|
|
|
})
|
|
|
|
|
|
|
|
|
- it('should throw an error if route id is empty', () => {
|
|
|
- route.value = {params: 'foo'}
|
|
|
- expect(() => useDataUtilsMount.getItemToEdit(route, Organization)).toThrowError('id must be exist')
|
|
|
+ it('should throw an error if id is empty', () => {
|
|
|
+ const component = mountComposition(() => {
|
|
|
+ expect(() => useDataUtilsMount.getItemToEdit(null, Organization)).toThrowError('id must be exist')
|
|
|
+ });
|
|
|
})
|
|
|
})
|