mirror of
https://github.com/tenrok/vue-select.git
synced 2026-06-22 10:30:34 +03:00
Fix console output in Jest runs
This commit is contained in:
@@ -13,7 +13,7 @@ describe("Labels", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("will console.warn when options contain objects without a valid label key", () => {
|
it("will console.warn when options contain objects without a valid label key", () => {
|
||||||
const spy = jest.spyOn(console, "warn");
|
const spy = jest.spyOn(console, "warn").mockImplementation(() => {});
|
||||||
const Select = selectWithProps({
|
const Select = selectWithProps({
|
||||||
options: [{}]
|
options: [{}]
|
||||||
});
|
});
|
||||||
@@ -28,7 +28,7 @@ describe("Labels", () => {
|
|||||||
it("should display a placeholder if the value is empty", () => {
|
it("should display a placeholder if the value is empty", () => {
|
||||||
const Select = shallowMount(VueSelect, {
|
const Select = shallowMount(VueSelect, {
|
||||||
propsData: {
|
propsData: {
|
||||||
options: [{ label: "one" }]
|
options: ["one"]
|
||||||
},
|
},
|
||||||
attrs: {
|
attrs: {
|
||||||
placeholder: "foo"
|
placeholder: "foo"
|
||||||
@@ -36,7 +36,7 @@ describe("Labels", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
expect(Select.vm.searchPlaceholder).toEqual("foo");
|
expect(Select.vm.searchPlaceholder).toEqual("foo");
|
||||||
Select.vm.mutableValue = { label: "one" };
|
Select.vm.mutableValue = "one";
|
||||||
expect(Select.vm.searchPlaceholder).not.toBeDefined();
|
expect(Select.vm.searchPlaceholder).not.toBeDefined();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -141,7 +141,7 @@ describe("When index prop is defined", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("will console.warn when attempting to select an option with an undefined index", () => {
|
it("will console.warn when attempting to select an option with an undefined index", () => {
|
||||||
const spy = jest.spyOn(console, "warn");
|
const spy = jest.spyOn(console, "warn").mockImplementation(() => {});
|
||||||
const Select = shallowMount(VueSelect, {
|
const Select = shallowMount(VueSelect, {
|
||||||
propsData: {
|
propsData: {
|
||||||
index: "value",
|
index: "value",
|
||||||
|
|||||||
Reference in New Issue
Block a user