mirror of
https://github.com/prymitive/karma
synced 2026-05-07 03:26:52 +00:00
fix(ui): reset silenceID to null when creating silence from group
This commit is contained in:
@@ -148,6 +148,9 @@ class SilenceFormStore {
|
||||
}
|
||||
|
||||
this.matchers = matchers;
|
||||
// ensure that silenceID is nulled, since it's used to edit silences
|
||||
// and this is used to silence groups
|
||||
this.silenceID = null;
|
||||
},
|
||||
|
||||
fillFormFromSilence(alertmanager, silence) {
|
||||
|
||||
@@ -187,6 +187,13 @@ describe("SilenceFormStore.data", () => {
|
||||
);
|
||||
});
|
||||
|
||||
it("fillMatchersFromGroup() resets silenceID if set", () => {
|
||||
store.data.silenceID = "12345";
|
||||
const group = MockGroup();
|
||||
store.data.fillMatchersFromGroup(group, [group.alerts[0]]);
|
||||
expect(store.data.silenceID).toBeNull();
|
||||
});
|
||||
|
||||
it("fillFormFromSilence() sets silenceID", () => {
|
||||
const alertmanager = MockAlertmanager();
|
||||
const silence = MockSilence();
|
||||
|
||||
Reference in New Issue
Block a user