From 149dfc3e6a4965cf3385e4a50f925f88f0ed7fc7 Mon Sep 17 00:00:00 2001 From: Nate Hunzaker Date: Mon, 1 Aug 2016 07:54:51 -0400 Subject: [PATCH] Add test coverage for setAttribute update. --- .../shared/__tests__/DOMPropertyOperations-test.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/renderers/dom/shared/__tests__/DOMPropertyOperations-test.js b/src/renderers/dom/shared/__tests__/DOMPropertyOperations-test.js index b75eb9bfe23b6..8c53c5c9a9890 100644 --- a/src/renderers/dom/shared/__tests__/DOMPropertyOperations-test.js +++ b/src/renderers/dom/shared/__tests__/DOMPropertyOperations-test.js @@ -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() {