From c3185a4cdbca67764237c771c0ac2245c79bf588 Mon Sep 17 00:00:00 2001 From: Stephen Solka Date: Mon, 24 Dec 2018 21:13:09 -0500 Subject: [PATCH] breaking changes from expect upgrade Signed-off-by: Stephen Solka --- test/DecryptionFailureTracker-test.js | 2 +- test/components/structures/GroupView-test.js | 40 +++++++++---------- .../dialogs/InteractiveAuthDialog-test.js | 4 +- .../views/groups/GroupMemberList-test.js | 4 +- test/components/views/rooms/RoomList-test.js | 4 +- test/matrix-to-test.js | 30 +++++++------- 6 files changed, 42 insertions(+), 42 deletions(-) diff --git a/test/DecryptionFailureTracker-test.js b/test/DecryptionFailureTracker-test.js index 617c9d5d68..baa0545f77 100644 --- a/test/DecryptionFailureTracker-test.js +++ b/test/DecryptionFailureTracker-test.js @@ -54,7 +54,7 @@ describe('DecryptionFailureTracker', function() { // Immediately track the newest failures tracker.trackFailures(); - expect(count).toNotBe(0, 'should track a failure for an event that failed decryption'); + expect(count).not.toBe(0, 'should track a failure for an event that failed decryption'); done(); }); diff --git a/test/components/structures/GroupView-test.js b/test/components/structures/GroupView-test.js index 89632dcc48..b49c335bdf 100644 --- a/test/components/structures/GroupView-test.js +++ b/test/components/structures/GroupView-test.js @@ -185,21 +185,21 @@ describe('GroupView', function() { const avatar = ReactTestUtils.findRenderedComponentWithType(root, sdk.getComponent('avatars.GroupAvatar')); const img = ReactTestUtils.findRenderedDOMComponentWithTag(avatar, 'img'); const avatarImgElement = ReactDOM.findDOMNode(img); - expect(avatarImgElement).toExist(); - expect(avatarImgElement.src).toInclude( + expect(avatarImgElement).toBeTruthy(); + expect(avatarImgElement.src).toContain( 'https://my.home.server/_matrix/media/v1/thumbnail/' + 'someavatarurl?width=48&height=48&method=crop', ); const name = ReactTestUtils.findRenderedDOMComponentWithClass(root, 'mx_GroupView_header_name'); const nameElement = ReactDOM.findDOMNode(name); - expect(nameElement).toExist(); - expect(nameElement.innerText).toInclude('The name of a community'); - expect(nameElement.innerText).toInclude(groupId); + expect(nameElement).toBeTruthy(); + expect(nameElement.innerText).toContain('The name of a community'); + expect(nameElement.innerText).toContain(groupId); const shortDesc = ReactTestUtils.findRenderedDOMComponentWithClass(root, 'mx_GroupView_header_shortDesc'); const shortDescElement = ReactDOM.findDOMNode(shortDesc); - expect(shortDescElement).toExist(); + expect(shortDescElement).toBeTruthy(); expect(shortDescElement.innerText).toBe('This is a community'); }); @@ -219,7 +219,7 @@ describe('GroupView', function() { const longDesc = ReactTestUtils.findRenderedDOMComponentWithClass(root, 'mx_GroupView_groupDesc'); const longDescElement = ReactDOM.findDOMNode(longDesc); - expect(longDescElement).toExist(); + expect(longDescElement).toBeTruthy(); expect(longDescElement.innerText).toBe('This is a LONG description.'); expect(longDescElement.innerHTML).toBe('
This is a LONG description.
'); }); @@ -239,7 +239,7 @@ describe('GroupView', function() { const placeholder = ReactTestUtils .findRenderedDOMComponentWithClass(root, 'mx_GroupView_groupDesc_placeholder'); const placeholderElement = ReactDOM.findDOMNode(placeholder); - expect(placeholderElement).toExist(); + expect(placeholderElement).toBeTruthy(); }); httpBackend @@ -258,15 +258,15 @@ describe('GroupView', function() { const prom = waitForUpdate(groupView, 4).then(() => { const longDesc = ReactTestUtils.findRenderedDOMComponentWithClass(root, 'mx_GroupView_groupDesc'); const longDescElement = ReactDOM.findDOMNode(longDesc); - expect(longDescElement).toExist(); + expect(longDescElement).toBeTruthy(); - expect(longDescElement.innerHTML).toInclude('

This is a more complicated group page

'); - expect(longDescElement.innerHTML).toInclude('

With paragraphs

'); - expect(longDescElement.innerHTML).toInclude('