mirror of
https://github.com/prymitive/karma
synced 2026-05-05 03:16:51 +00:00
fix(tests): resolve mobx errors
This commit is contained in:
committed by
Łukasz Mierzwa
parent
fd73a5ad21
commit
98dc112fdc
@@ -13,12 +13,15 @@ beforeEach(() => {
|
||||
const NonEqualMatchers = ["!=", "=~", "!~", ">", "<"];
|
||||
|
||||
const MockColors = () => {
|
||||
alertStore.data.colors["foo"] = {
|
||||
bar: {
|
||||
brightness: 200,
|
||||
background: "rgba(4,5,6,200)",
|
||||
alertStore.data.setColors({
|
||||
foo: {
|
||||
bar: {
|
||||
brightness: 200,
|
||||
background: "rgba(4,5,6,200)",
|
||||
},
|
||||
},
|
||||
};
|
||||
...alertStore.data.colors,
|
||||
});
|
||||
};
|
||||
|
||||
const ShallowLabel = (
|
||||
|
||||
@@ -67,23 +67,29 @@ describe("<FilteringLabel />", () => {
|
||||
});
|
||||
|
||||
it("label with dark background color should have 'components-label-dark' class", () => {
|
||||
alertStore.data.colors["foo"] = {
|
||||
bar: {
|
||||
brightness: 125,
|
||||
background: "rgba(4,5,6,200)",
|
||||
alertStore.data.setColors({
|
||||
foo: {
|
||||
bar: {
|
||||
brightness: 125,
|
||||
background: "rgba(4,5,6,200)",
|
||||
},
|
||||
},
|
||||
};
|
||||
...alertStore.data.colors,
|
||||
});
|
||||
const tree = MountedFilteringLabel("foo", "bar");
|
||||
expect(tree.hasClass("components-label-dark")).toBe(true);
|
||||
});
|
||||
|
||||
it("label with bright background color should have 'components-label-bright' class", () => {
|
||||
alertStore.data.colors["foo"] = {
|
||||
bar: {
|
||||
brightness: 200,
|
||||
background: "rgba(4,5,6,200)",
|
||||
alertStore.data.setColors({
|
||||
foo: {
|
||||
bar: {
|
||||
brightness: 200,
|
||||
background: "rgba(4,5,6,200)",
|
||||
},
|
||||
},
|
||||
};
|
||||
...alertStore.data.colors,
|
||||
});
|
||||
const tree = MountedFilteringLabel("foo", "bar");
|
||||
expect(tree.hasClass("components-label-bright")).toBe(true);
|
||||
});
|
||||
|
||||
@@ -35,12 +35,15 @@ describe("<HistoryLabel />", () => {
|
||||
});
|
||||
|
||||
it("label with dark background color should have 'components-label-dark' class", () => {
|
||||
alertStore.data.colors["foo"] = {
|
||||
bar: {
|
||||
brightness: 125,
|
||||
background: "rgba(4,5,6,200)",
|
||||
alertStore.data.setColors({
|
||||
foo: {
|
||||
bar: {
|
||||
brightness: 125,
|
||||
background: "rgba(4,5,6,200)",
|
||||
},
|
||||
},
|
||||
};
|
||||
...alertStore.data.colors,
|
||||
});
|
||||
const tree = ShallowHistoryLabel("foo", "=", "bar").find(
|
||||
".components-label",
|
||||
);
|
||||
@@ -48,12 +51,15 @@ describe("<HistoryLabel />", () => {
|
||||
});
|
||||
|
||||
it("label with bright background color should have 'components-label-bright' class", () => {
|
||||
alertStore.data.colors["foo"] = {
|
||||
bar: {
|
||||
brightness: 200,
|
||||
background: "rgba(4,5,6,200)",
|
||||
alertStore.data.setColors({
|
||||
foo: {
|
||||
bar: {
|
||||
brightness: 200,
|
||||
background: "rgba(4,5,6,200)",
|
||||
},
|
||||
},
|
||||
};
|
||||
...alertStore.data.colors,
|
||||
});
|
||||
const tree = ShallowHistoryLabel("foo", "=", "bar").find(
|
||||
".components-label",
|
||||
);
|
||||
|
||||
@@ -23,12 +23,15 @@ describe("<StaticLabel />", () => {
|
||||
});
|
||||
|
||||
it("label with dark background color should have 'components-label-dark' class", () => {
|
||||
alertStore.data.colors["foo"] = {
|
||||
bar: {
|
||||
brightness: 125,
|
||||
background: "rgba(4,5,6,200)",
|
||||
alertStore.data.setColors({
|
||||
foo: {
|
||||
bar: {
|
||||
brightness: 125,
|
||||
background: "rgba(4,5,6,200)",
|
||||
},
|
||||
},
|
||||
};
|
||||
...alertStore.data.colors,
|
||||
});
|
||||
const tree = MountedStaticLabel();
|
||||
expect(
|
||||
tree.find(".components-label").hasClass("components-label-dark"),
|
||||
@@ -36,12 +39,15 @@ describe("<StaticLabel />", () => {
|
||||
});
|
||||
|
||||
it("label with bright background color should have 'components-label-bright' class", () => {
|
||||
alertStore.data.colors["foo"] = {
|
||||
bar: {
|
||||
brightness: 200,
|
||||
background: "rgba(4,5,6,200)",
|
||||
alertStore.data.setColors({
|
||||
foo: {
|
||||
bar: {
|
||||
brightness: 200,
|
||||
background: "rgba(4,5,6,200)",
|
||||
},
|
||||
},
|
||||
};
|
||||
...alertStore.data.colors,
|
||||
});
|
||||
const tree = MountedStaticLabel();
|
||||
expect(
|
||||
tree.find(".components-label").hasClass("components-label-bright"),
|
||||
|
||||
Reference in New Issue
Block a user