mirror of
https://github.com/prymitive/karma
synced 2026-05-15 04:06:41 +00:00
chore(ui): user offset and raw filter from the api response
This commit is contained in:
@@ -6,7 +6,7 @@ import { mount } from "enzyme";
|
||||
|
||||
import toDiffableHtml from "diffable-html";
|
||||
|
||||
import { AlertStore } from "Stores/AlertStore";
|
||||
import { AlertStore, NewUnappliedFilter } from "Stores/AlertStore";
|
||||
import { OverviewModalContent } from "./OverviewModalContent";
|
||||
|
||||
let alertStore;
|
||||
@@ -23,14 +23,31 @@ afterEach(() => {
|
||||
|
||||
describe("<OverviewModalContent />", () => {
|
||||
it("matches snapshot with labels to show", () => {
|
||||
alertStore.filters.values = [
|
||||
NewUnappliedFilter("abc=xyz"),
|
||||
NewUnappliedFilter("foo=bar")
|
||||
];
|
||||
alertStore.data.counters = [
|
||||
{
|
||||
name: "foo",
|
||||
hits: 16,
|
||||
values: [
|
||||
{ value: "bar1", hits: 8, percent: 50 },
|
||||
{ value: "bar2", hits: 4, percent: 25 },
|
||||
{ value: "bar3", hits: 4, percent: 25 }
|
||||
{ value: "bar1", raw: "foo=bar1", hits: 8, percent: 50, offset: 0 },
|
||||
{ value: "bar2", raw: "foo=bar2", hits: 4, percent: 25, offset: 50 },
|
||||
{ value: "bar3", raw: "foo=bar3", hits: 4, percent: 25, offset: 75 }
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "alertname",
|
||||
hits: 5,
|
||||
values: [
|
||||
{
|
||||
value: "Host_Down",
|
||||
raw: "alertname=Host_Down",
|
||||
hits: 5,
|
||||
percent: 100,
|
||||
offset: 0
|
||||
}
|
||||
]
|
||||
}
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user