Merge pull request #1085 from prymitive/percy

chore(ci): mock counters in storybook
This commit is contained in:
Łukasz Mierzwa
2019-10-27 15:22:00 +00:00
committed by GitHub

View File

@@ -33,7 +33,7 @@ storiesOf("SilenceModal", module)
</div>
</div>
))
.add("Silence Form", () => {
.add("Editor", () => {
const alertStore = new AlertStore([]);
const settingsStore = new Settings();
const silenceFormStore = new SilenceFormStore();
@@ -58,6 +58,21 @@ storiesOf("SilenceModal", module)
silenceFormStore.tab.current = SilenceTabNames.Editor;
fetchMock.mock(
"begin:/alerts.json?q=cluster",
{ totalAlerts: 0 },
{
overwriteRoutes: true
}
);
fetchMock.mock(
"begin:/alerts.json?q=instance",
{ totalAlerts: 23 },
{
overwriteRoutes: true
}
);
return (
<SilenceModalContent
alertStore={alertStore}
@@ -114,7 +129,9 @@ storiesOf("SilenceModal", module)
});
}
fetchMock.restore().mock("*", silences);
fetchMock.mock("begin:/silences.json?", silences, {
overwriteRoutes: true
});
return (
<SilenceModalContent