Skip to content

Commit a5045b0

Browse files
committed
Updated Tests for LicenseDropdown.vue
1 parent eb3f3a9 commit a5045b0

File tree

1 file changed

+11
-20
lines changed

1 file changed

+11
-20
lines changed

tests/unit/LicenseDropdown.spec.js

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import LicenseDropdown from "@/Components/LicenseDropdown.vue";
33
import VueI18n from "vue-i18n";
44
import Vuex from "vuex";
55
import Buefy from "buefy";
6-
import { doesNotReject } from "assert";
76

87
describe("LicenseDropdown.vue", () => {
98
let wrapper;
@@ -16,38 +15,31 @@ describe("LicenseDropdown.vue", () => {
1615
localVue.use(Vuex);
1716
localVue.use(Buefy);
1817

19-
getters = {
20-
shortName: state => {
21-
return "foo";
22-
},
23-
fullName: state => {
24-
return "foo-bar";
25-
}
26-
};
18+
const language = require("../../src/locales/en.json");
19+
20+
const i18n = new VueI18n({
21+
locale: "en",
22+
fallbackLocale: "en",
23+
messages: language
24+
});
2725

2826
store = new Vuex.Store({
2927
getters
3028
});
3129

32-
const messages = require("@/locales/en.json");
33-
const i18n = new VueI18n({
34-
locale: "en",
35-
fallbackLocale: "en",
36-
messages: messages
30+
wrapper = mount(LicenseDropdown, {
31+
localVue,
32+
store
3733
});
3834

3935
config.mocks.i18n = i18n;
4036

4137
config.mocks.$t = key => {
4238
return i18n.messages[key];
4339
};
44-
wrapper = mount(LicenseDropdown, {
45-
localVue,
46-
store
47-
});
4840
});
4941

50-
it("Has the main field tag", () => {
42+
it("Has the field tag", () => {
5143
expect(wrapper.contains(".license-dropdown")).toBe(true);
5244
});
5345

@@ -67,5 +59,4 @@ describe("LicenseDropdown.vue", () => {
6759
.at(0)
6860
.trigger("input");
6961
});
70-
7162
});

0 commit comments

Comments
 (0)