Skip to content

Commit

Permalink
Add test case for progress elements
Browse files Browse the repository at this point in the history
  • Loading branch information
nhunzaker committed Sep 29, 2016
1 parent 5d8c8ef commit 4e5ac47
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -824,7 +824,7 @@ describe('ReactDOMInput', () => {
});

it('sets type, step, min, max before value always', () => {
if (!ReactDOMFeatureFlags.useCreateElement) {
if (!ReactDOMFeatureFlags.us3eCreateElement) {
return;
}
var log = [];
Expand Down Expand Up @@ -852,7 +852,8 @@ describe('ReactDOMInput', () => {
'set step',
'set min',
'set max',
'set value',
'set value', // attribute
'set value', // property
]);
});

Expand Down
13 changes: 13 additions & 0 deletions src/renderers/dom/shared/__tests__/DOMPropertyOperations-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,19 @@ describe('DOMPropertyOperations', () => {
expect(stubNode.value).toBe('');
});

it('should always assign the value attribute for non-inputs', function() {
var stubNode = document.createElement('progress');
var stubInstance = {_debugID: 1};
ReactDOMComponentTree.precacheNode(stubInstance, stubNode);

spyOn(stubNode, 'setAttribute');

DOMPropertyOperations.setValueForProperty(stubNode, 'value', 30);
DOMPropertyOperations.setValueForProperty(stubNode, 'value', '30');

expect(stubNode.setAttribute.calls.count()).toBe(2);
});

it('should not leave all options selected when deleting multiple', () => {
stubNode = document.createElement('select');
ReactDOMComponentTree.precacheNode(stubInstance, stubNode);
Expand Down

0 comments on commit 4e5ac47

Please sign in to comment.