react / react-0.13.3 / examples / basic-commonjs / node_modules / reactify / node_modules / react-tools / src / browser / ui / __tests__ / ReactDOMIDOperations-test.js
81159 views/**1* Copyright 2013-2014, Facebook, Inc.2* All rights reserved.3*4* This source code is licensed under the BSD-style license found in the5* LICENSE file in the root directory of this source tree. An additional grant6* of patent rights can be found in the PATENTS file in the same directory.7*8* @emails react-core9*/1011/*jslint evil: true */1213"use strict";1415describe('ReactDOMIDOperations', function() {16var DOMPropertyOperations = require('DOMPropertyOperations');17var ReactDOMIDOperations = require('ReactDOMIDOperations');18var ReactMount = require('ReactMount');19var keyOf = require('keyOf');2021it('should disallow updating special properties', function() {22spyOn(ReactMount, "getNode");23spyOn(DOMPropertyOperations, "setValueForProperty");2425expect(function() {26ReactDOMIDOperations.updatePropertyByID(27'testID',28keyOf({dangerouslySetInnerHTML: null}),29{__html: 'testContent'}30);31}).toThrow();3233expect(34ReactMount.getNode.argsForCall[0][0]35).toBe('testID');3637expect(38DOMPropertyOperations.setValueForProperty.callCount39).toBe(0);40});4142it('should update innerHTML and preserve whitespace', function() {43var stubNode = document.createElement('div');44spyOn(ReactMount, "getNode").andReturn(stubNode);4546var html = '\n \t <span> \n testContent \t </span> \n \t';4748ReactDOMIDOperations.updateInnerHTMLByID(49'testID',50html51);5253expect(54ReactMount.getNode.argsForCall[0][0]55).toBe('testID');5657expect(stubNode.innerHTML).toBe(html);58});59});606162