forked from konfuzio-ai/document-validation-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create separate modules for unit tests
- Loading branch information
1 parent
6a70774
commit d2bfede
Showing
5 changed files
with
106 additions
and
161 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
// mock i18n so we don't need to load the library | ||
export const $t = () => {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { mount, shallowMount } from "@vue/test-utils"; | ||
import { $t } from "./i18n"; | ||
import store from "../../src/store"; | ||
|
||
export const render = (component, shallow, propsData = {}, data = {}) => { | ||
const values = { | ||
store, | ||
propsData, | ||
mocks: { | ||
$t, | ||
}, | ||
data() { | ||
return data; | ||
}, | ||
}; | ||
|
||
if (shallow) { | ||
return shallowMount(component, values); | ||
} else { | ||
return mount(component, values); | ||
} | ||
}; |
Oops, something went wrong.