Skip to content

Commit

Permalink
Add test coverage for setAttribute update.
Browse files Browse the repository at this point in the history
  • Loading branch information
nhunzaker committed Aug 2, 2016
1 parent b9ccffa commit 1b097ff
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/renderers/dom/shared/__tests__/DOMPropertyOperations-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,18 @@ describe('DOMPropertyOperations', function() {
expect(stubNode.className).toBe('');
});

it('should not update numeric values when the input.value is loosely the same', function() {
stubNode.setAttribute('type', 'number');
stubNode.setAttribute('value', '3e1');
// Keep in sync. The comparison occurs between setAttribute and value.
stubNode.value = '3e1';

spyOn(stubNode, 'setAttribute');

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

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

describe('deleteValueForProperty', function() {
Expand Down

0 comments on commit 1b097ff

Please sign in to comment.