mirror of
https://github.com/prymitive/karma
synced 2026-05-05 03:16:51 +00:00
fix(tests): add alert fingerprint to prop validation
This commit is contained in:
committed by
Łukasz Mierzwa
parent
f1dec5aedf
commit
2dd1897937
@@ -89,6 +89,7 @@ describe("<Alert />", () => {
|
||||
const alert = MockedAlert();
|
||||
alert.alertmanager[0].inhibitedBy = ["123456"];
|
||||
alert.alertmanager.push({
|
||||
fingerprint: "abc",
|
||||
name: "ha2",
|
||||
cluster: "HA",
|
||||
state: "active",
|
||||
@@ -123,6 +124,7 @@ describe("<Alert />", () => {
|
||||
it("only renders one @cluster label per alertmanager cluster", () => {
|
||||
const alert = MockedAlert();
|
||||
alert.alertmanager.push({
|
||||
fingerprint: "123",
|
||||
name: "ha1",
|
||||
cluster: "HA",
|
||||
state: "active",
|
||||
@@ -132,6 +134,7 @@ describe("<Alert />", () => {
|
||||
inhibitedBy: [],
|
||||
});
|
||||
alert.alertmanager.push({
|
||||
fingerprint: "123",
|
||||
name: "ha2",
|
||||
cluster: "HA",
|
||||
state: "active",
|
||||
@@ -209,6 +212,7 @@ describe("<Alert />", () => {
|
||||
const alert = MockedAlert();
|
||||
alert.alertmanager = [
|
||||
{
|
||||
fingerprint: "123",
|
||||
name: "am1",
|
||||
cluster: "ha",
|
||||
state: "suppressed",
|
||||
@@ -218,6 +222,7 @@ describe("<Alert />", () => {
|
||||
inhibitedBy: [],
|
||||
},
|
||||
{
|
||||
fingerprint: "123",
|
||||
name: "am2",
|
||||
cluster: "ha",
|
||||
state: "suppressed",
|
||||
|
||||
@@ -130,6 +130,7 @@ describe("<AlertGroup />", () => {
|
||||
MockAlerts(2);
|
||||
for (let i = 0; i < group.alerts.length; i++) {
|
||||
group.alerts[i].alertmanager.push({
|
||||
fingerprint: "123",
|
||||
name: "ha1",
|
||||
cluster: "HA",
|
||||
state: "active",
|
||||
@@ -139,6 +140,7 @@ describe("<AlertGroup />", () => {
|
||||
inhibitedBy: [],
|
||||
});
|
||||
group.alerts[i].alertmanager.push({
|
||||
fingerprint: "123",
|
||||
name: "ha2",
|
||||
cluster: "HA",
|
||||
state: "active",
|
||||
|
||||
@@ -10,6 +10,7 @@ const Annotation = PropTypes.exact({
|
||||
});
|
||||
|
||||
const APIAlertAlertmanagerState = PropTypes.exact({
|
||||
fingerprint: PropTypes.string.isRequired,
|
||||
name: PropTypes.string.isRequired,
|
||||
cluster: PropTypes.string.isRequired,
|
||||
state: AlertState.isRequired,
|
||||
|
||||
@@ -13,6 +13,7 @@ const MockAlert = (annotations, labels, state) => ({
|
||||
state: state,
|
||||
alertmanager: [
|
||||
{
|
||||
fingerprint: "1234567",
|
||||
name: "default",
|
||||
cluster: "default",
|
||||
state: "active",
|
||||
@@ -67,6 +68,7 @@ const MockSilence = () => ({
|
||||
});
|
||||
|
||||
const MockAlertmanager = () => ({
|
||||
fingerprint: "1234567",
|
||||
name: "default",
|
||||
cluster: "default",
|
||||
uri: "http://localhost",
|
||||
|
||||
Reference in New Issue
Block a user