aboutsummaryrefslogtreecommitdiff
path: root/thirdparty/preact/test/browser/linked-state.js
diff options
context:
space:
mode:
Diffstat (limited to 'thirdparty/preact/test/browser/linked-state.js')
-rw-r--r--thirdparty/preact/test/browser/linked-state.js20
1 files changed, 16 insertions, 4 deletions
diff --git a/thirdparty/preact/test/browser/linked-state.js b/thirdparty/preact/test/browser/linked-state.js
index 1ca84cdc6..03db2a7b8 100644
--- a/thirdparty/preact/test/browser/linked-state.js
+++ b/thirdparty/preact/test/browser/linked-state.js
@@ -26,7 +26,10 @@ describe('linked-state', () => {
element.type= 'text';
element.value = 'newValue';
- linkFunction({ currentTarget: element });
+ linkFunction({
+ currentTarget: element,
+ target: element
+ });
expect(TestComponent.prototype.setState).to.have.been.calledOnce;
expect(TestComponent.prototype.setState).to.have.been.calledWith({'testStateKey': 'newValue'});
@@ -42,7 +45,10 @@ describe('linked-state', () => {
checkboxElement.type= 'checkbox';
checkboxElement.checked = true;
- linkFunction({ currentTarget: checkboxElement });
+ linkFunction({
+ currentTarget: checkboxElement,
+ target: checkboxElement
+ });
expect(TestComponent.prototype.setState).to.have.been.calledOnce;
expect(TestComponent.prototype.setState).to.have.been.calledWith({'testStateKey': true});
@@ -53,7 +59,10 @@ describe('linked-state', () => {
radioElement.type= 'radio';
radioElement.checked = true;
- linkFunction({ currentTarget: radioElement });
+ linkFunction({
+ currentTarget: radioElement,
+ target: radioElement
+ });
expect(TestComponent.prototype.setState).to.have.been.calledOnce;
expect(TestComponent.prototype.setState).to.have.been.calledWith({'testStateKey': true});
@@ -66,7 +75,10 @@ describe('linked-state', () => {
element.type= 'text';
element.value = 'newValue';
- linkFunction({ currentTarget: element });
+ linkFunction({
+ currentTarget: element,
+ target: element
+ });
expect(TestComponent.prototype.setState).to.have.been.calledOnce;
expect(TestComponent.prototype.setState).to.have.been.calledWith({nested: {state: {key: 'newValue'}}});