-
Notifications
You must be signed in to change notification settings - Fork 273
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(ui5-slider): fire 'change' event on keyup (#10803)
* fix(ui5-slider): fire 'change' event on keyup fixes: #10770
- Loading branch information
Showing
3 changed files
with
39 additions
and
0 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,26 @@ | ||
import Slider from "../../src/Slider.js"; | ||
|
||
describe("General interactions", () => { | ||
it("Fire change event on keyup", () => { | ||
let changeCount = 0; | ||
cy.mount( | ||
<Slider min={0} max={20}></Slider> | ||
); | ||
|
||
cy.get("[ui5-slider]").then($slider => { | ||
$slider[0].addEventListener("ui5-change", () => { | ||
changeCount++; | ||
}); | ||
}); | ||
|
||
// First 'change' event is fired when the slider is clicked | ||
cy.get("[ui5-slider]").click(); | ||
|
||
// Second 'change' event is fired on keyboard interaction | ||
cy.get("[ui5-slider]").realPress("ArrowRight"); | ||
|
||
cy.then(() => { | ||
expect(changeCount).to.equal(2); | ||
}); | ||
}); | ||
}); |
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