Skip to content

Commit

Permalink
Ensure dashboard UI unit tests reflect changes in check filter editor…
Browse files Browse the repository at this point in the history
… validation #258.
  • Loading branch information
MichaelBurgess committed Mar 15, 2024
1 parent 4b4e291 commit a7b19d0
Showing 1 changed file with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,18 @@ interface TestCase {

const filterTestCases: TestCase[] = [
{
name: "valid filter with type and key",
input: { operator: "equal", type: "resource", key: "name" },
name: "valid filter with type and value",
input: { operator: "equal", type: "status", value: "alarm" },
expected: true,
},
{
name: "valid filter with type and value",
input: { operator: "equal", type: "control_tag", value: "production" },
name: "valid filter with type, key and value",
input: {
operator: "equal",
type: "control_tag",
key: "environment",
value: "production",
},
expected: true,
},
{
Expand All @@ -27,6 +32,11 @@ const filterTestCases: TestCase[] = [
input: { operator: "equal", key: "name" },
expected: false,
},
{
name: "filter missing value",
input: { operator: "equal", type: "control_tag", key: "environment" },
expected: false,
},
{
name: "filter missing both key and value",
input: { operator: "equal", type: "resource" },
Expand Down

0 comments on commit a7b19d0

Please sign in to comment.