fix delete message test by making it independant

pull/1137/head
Audric Ackermann 5 years ago
parent 8606280080
commit 779be1213e
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4

@ -4,7 +4,7 @@
/* eslint-disable import/no-extraneous-dependencies */ /* eslint-disable import/no-extraneous-dependencies */
const path = require('path'); const path = require('path');
const { after, before, describe, it } = require('mocha'); const { afterEach, beforeEach, describe, it } = require('mocha');
const common = require('./common'); const common = require('./common');
const ConversationPage = require('./page-objects/conversation.page'); const ConversationPage = require('./page-objects/conversation.page');
@ -14,23 +14,22 @@ describe('Message Functions', function() {
this.timeout(60000); this.timeout(60000);
this.slow(15000); this.slow(15000);
before(async () => { beforeEach(async () => {
await common.killallElectron(); await common.killallElectron();
await common.stopStubSnodeServer(); await common.stopStubSnodeServer();
[app, app2] = await common.startAppsAsFriends(); [app, app2] = await common.startAppsAsFriends();
// create group and add new friend
await common.addFriendToNewClosedGroup(app, app2);
}); });
after(async () => { afterEach(async () => {
await common.stopApp(app); await common.stopApp(app);
await common.killallElectron(); await common.killallElectron();
await common.stopStubSnodeServer(); await common.stopStubSnodeServer();
}); });
it('can send attachment', async () => { it('can send attachment', async () => {
// create group and add new friend
await common.addFriendToNewClosedGroup(app, app2);
// send attachment from app1 to closed group // send attachment from app1 to closed group
const fileLocation = path.join(__dirname, 'test_attachment'); const fileLocation = path.join(__dirname, 'test_attachment');
const messageText = 'test_attachment'; const messageText = 'test_attachment';
@ -68,7 +67,7 @@ describe('Message Functions', function() {
.click(); .click();
await app.client.element(ConversationPage.deleteMessageCtxButton).click(); await app.client.element(ConversationPage.deleteMessageCtxButton).click();
// delete messaage from modal // delete message from modal
await app.client.waitForExist( await app.client.waitForExist(
ConversationPage.deleteMessageModalButton, ConversationPage.deleteMessageModalButton,
5000 5000

@ -105,7 +105,7 @@ export class LeftPaneSectionHeader extends React.Component<Props, State> {
count={notificationCount} count={notificationCount}
size={NotificationCountSize.ON_HEADER} size={NotificationCountSize.ON_HEADER}
onClick={this.props.buttonClicked} onClick={this.props.buttonClicked}
key='notification-count' // we can only have one of those here key="notification-count" // we can only have one of those here
/> />
</div> </div>
); );
@ -115,7 +115,7 @@ export class LeftPaneSectionHeader extends React.Component<Props, State> {
count={notificationCount} count={notificationCount}
size={NotificationCountSize.ON_HEADER} size={NotificationCountSize.ON_HEADER}
onClick={this.props.buttonClicked} onClick={this.props.buttonClicked}
key='notification-count' // we can only have one of those here key="notification-count" // we can only have one of those here
/> />
); );
} }

Loading…
Cancel
Save