-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into MERX-917-failed-event-deliveries-message
- Loading branch information
Showing
13 changed files
with
168 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"saleor-dashboard": patch | ||
--- | ||
|
||
Fix a group of errors caused by reading property of undefined |
33 changes: 33 additions & 0 deletions
33
src/components/ConditionalFilter/FilterElement/ConditionValue.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { slugFromConditionValue } from "./ConditionValue"; | ||
|
||
describe("slugFromConditionValue", () => { | ||
it("should return string when input is string", () => { | ||
const result = slugFromConditionValue("test"); | ||
|
||
expect(result).toBe("test"); | ||
}); | ||
|
||
it("should return slug when input is ItemOption", () => { | ||
const result = slugFromConditionValue({ label: "test", value: "test", slug: "test" }); | ||
|
||
expect(result).toBe("test"); | ||
}); | ||
|
||
it("should return slug when input is ItemOption array", () => { | ||
const result = slugFromConditionValue([{ label: "test", value: "test", slug: "test" }]); | ||
|
||
expect(result).toEqual(["test"]); | ||
}); | ||
|
||
it("should return slug when input is tuple", () => { | ||
const result = slugFromConditionValue(["test", "test"]); | ||
|
||
expect(result).toEqual(["test", "test"]); | ||
}); | ||
|
||
it("should return empty string when input is undefined", () => { | ||
const result = slugFromConditionValue(undefined); | ||
|
||
expect(result).toBe(""); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { areMetadataArraysEqual } from "./metadataUpdateHelpers"; | ||
|
||
describe("metadataUpdateHelpers", () => { | ||
describe("areMetadataArraysEqual", () => { | ||
it("should return false if before or after is undefined", () => { | ||
expect(areMetadataArraysEqual(undefined, [])).toBe(false); | ||
expect(areMetadataArraysEqual([], undefined)).toBe(false); | ||
}); | ||
|
||
it("should return true if arrays are equal", () => { | ||
const before = [{ key: "key1", value: "value1" }]; | ||
const after = [{ key: "key1", value: "value1" }]; | ||
|
||
expect(areMetadataArraysEqual(before, after)).toBe(true); | ||
}); | ||
|
||
it("should return false if arrays are not equal", () => { | ||
const before = [{ key: "key1", value: "value1" }]; | ||
const after = [{ key: "key2", value: "value2" }]; | ||
|
||
expect(areMetadataArraysEqual(before, after)).toBe(false); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters