mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
This commit is contained in:
1 parent
07fefe3331
commit
85fe4ddce7
2 files changed
+9
-3
No files matched your search
+8
-2
@@ -739,9 +739,12 @@ describe('ReactDOMInput', () => {
|
||||
const cNode = stub.refs.c;
|
||||
|
||||
expect(aNode.checked).toBe(true);
|
||||
expect(aNode.hasAttribute('checked')).toBe(true);
|
||||
expect(bNode.checked).toBe(false);
|
||||
expect(bNode.hasAttribute('checked')).toBe(false);
|
||||
// c is in a separate form and shouldn't be affected at all here
|
||||
expect(cNode.checked).toBe(true);
|
||||
expect(cNode.hasAttribute('checked')).toBe(true);
|
||||
|
||||
bNode.checked = true;
|
||||
// This next line isn't necessary in a proper browser environment, but
|
||||
@@ -750,6 +753,11 @@ describe('ReactDOMInput', () => {
|
||||
aNode.checked = false;
|
||||
expect(cNode.checked).toBe(true);
|
||||
|
||||
// The original 'checked' attribute should be unchanged
|
||||
expect(aNode.hasAttribute('checked')).toBe(true);
|
||||
expect(bNode.hasAttribute('checked')).toBe(false);
|
||||
expect(cNode.hasAttribute('checked')).toBe(true);
|
||||
|
||||
// Now let's run the actual ReactDOMInput change event handler
|
||||
ReactTestUtils.Simulate.change(bNode);
|
||||
|
||||
@@ -1324,7 +1332,6 @@ describe('ReactDOMInput', () => {
|
||||
'set property value',
|
||||
'set attribute value',
|
||||
'set attribute checked',
|
||||
'set attribute checked',
|
||||
]);
|
||||
});
|
||||
|
||||
@@ -1389,7 +1396,6 @@ describe('ReactDOMInput', () => {
|
||||
'node.value = "1980-01-01"',
|
||||
'node.setAttribute("value", "1980-01-01")',
|
||||
'node.setAttribute("checked", "")',
|
||||
'node.setAttribute("checked", "")',
|
||||
]);
|
||||
});
|
||||
|
||||
|
||||
+1
-1
@@ -243,7 +243,7 @@ export function postMountWrapper(
|
||||
node.name = '';
|
||||
}
|
||||
node.defaultChecked = !node.defaultChecked;
|
||||
node.defaultChecked = !node.defaultChecked;
|
||||
node.defaultChecked = !!node._wrapperState.initialChecked;
|
||||
if (name !== '') {
|
||||
node.name = name;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user