'getElementsByClassName' doesn't exist in IE8
Fixes #532.
Ben Alpert committed
Nov 24, 2013 at 01:21 UTC
b99fd9368443cd66bffa397d47f1f4150adf383a
1 file changed
+4
-8
src/core/__tests__/ReactMountDestruction-test.js
+4
-8
@@ -43,17 +43,13 @@ describe('ReactMount', function() {
43
React.renderComponent(instanceTwo, secondRootDiv);
44
45
// Test that two react roots are rendered in isolation
46
- expect(firstRootDiv.getElementsByClassName('firstReactDiv').length)
47
- .toBe(1);
48
- expect(secondRootDiv.getElementsByClassName('secondReactDiv').length)
49
- .toBe(1);
46
+ expect(firstRootDiv.firstChild.className).toBe('firstReactDiv');
47
+ expect(secondRootDiv.firstChild.className).toBe('secondReactDiv');
48
49
// Test that after unmounting each, they are no longer in the document.
50
React.unmountComponentAtNode(firstRootDiv);
53
- expect(firstRootDiv.getElementsByClassName('firstReactDiv').length)
54
- .toBe(0);
51
+ expect(firstRootDiv.firstChild).toBeNull();
52
React.unmountComponentAtNode(secondRootDiv);
56
- expect(secondRootDiv.getElementsByClassName('secondReactDiv').length)
57
- .toBe(0);
53
+ expect(secondRootDiv.firstChild).toBeNull();
54
});
55
});