mirror of
https://github.com/prymitive/karma
synced 2026-05-07 03:26:52 +00:00
committed by
Łukasz Mierzwa
parent
7b86c6bcff
commit
3febf7d0a2
@@ -1,5 +1,11 @@
|
||||
# Changelog
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
### Fixed
|
||||
|
||||
- Don't reset regex toggle when adding new silence labels #2520
|
||||
|
||||
## v0.77
|
||||
|
||||
### Fixed
|
||||
|
||||
@@ -102,14 +102,14 @@ describe("<LabelValueInput />", () => {
|
||||
expect(matcher.isRegex).toBe(false);
|
||||
});
|
||||
|
||||
it("selecting one option when matcher.isRegex=true changes it back to false", () => {
|
||||
it("selecting one option when matcher.isRegex=true doesn't change it back to false", () => {
|
||||
matcher.isRegex = true;
|
||||
const tree = MountedLabelValueInput(true);
|
||||
tree.find("input").simulate("change", { target: { value: "f" } });
|
||||
expect(matcher.isRegex).toBe(true);
|
||||
const options = tree.find("div.react-select__option");
|
||||
options.at(0).simulate("click");
|
||||
expect(matcher.isRegex).toBe(false);
|
||||
expect(matcher.isRegex).toBe(true);
|
||||
});
|
||||
|
||||
it("selecting multiple options forces matcher.isRegex=true", () => {
|
||||
|
||||
@@ -101,8 +101,6 @@ const LabelValueInput: FC<{
|
||||
// force regex if we have multiple values
|
||||
if (matcher.values.length > 1 && matcher.isRegex === false) {
|
||||
matcher.isRegex = true;
|
||||
} else if (matcher.values.length === 1 && matcher.isRegex === true) {
|
||||
matcher.isRegex = false;
|
||||
}
|
||||
}}
|
||||
hideSelectedOptions
|
||||
|
||||
Reference in New Issue
Block a user