|
|
|
|
@ -11,14 +11,112 @@ import {checkIfUserIsValid, publicChannelCreated, setPublicChannelCreated} from |
|
|
|
|
import {publicChannelName} from '../../data/channel.js'; |
|
|
|
|
import {targetUser} from '../../data/interactions.js'; |
|
|
|
|
|
|
|
|
|
describe('channel usage', ()=> { |
|
|
|
|
describe('channel', ()=> { |
|
|
|
|
before(() => { |
|
|
|
|
checkIfUserIsValid(username, email, password); |
|
|
|
|
checkIfUserIsValid(username, email, password);checkIfUserIsValid(username, email, password); |
|
|
|
|
if (!publicChannelCreated) { |
|
|
|
|
sideNav.createChannel(publicChannelName, false, false); |
|
|
|
|
setPublicChannelCreated(true); |
|
|
|
|
console.log('public channel not found, creating one...'); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
describe('channel search', ()=> { |
|
|
|
|
describe('searching with spotlightSearch', () => { |
|
|
|
|
describe('rocket.cat', () => { |
|
|
|
|
beforeEach(() => { |
|
|
|
|
sideNav.getChannelFromSpotlight('rocket.cat').waitForVisible(5000); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
afterEach(() => { |
|
|
|
|
sideNav.spotlightSearch.setValue(''); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
it('should search rocket cat', () => { |
|
|
|
|
sideNav.getChannelFromSpotlight('rocket.cat').isVisible().should.be.true; |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
it('should start a direct message with rocket.cat', () => { |
|
|
|
|
sideNav.searchChannel('rocket.cat'); |
|
|
|
|
mainContent.channelTitle.getText().should.equal('rocket.cat'); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
describe('general', () => { |
|
|
|
|
beforeEach(() => { |
|
|
|
|
sideNav.getChannelFromSpotlight('general').waitForVisible(5000); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
afterEach(() => { |
|
|
|
|
sideNav.spotlightSearch.setValue(''); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
it('should search general', () => { |
|
|
|
|
sideNav.getChannelFromSpotlight('general').isVisible().should.be.true; |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
it('should go to general', () => { |
|
|
|
|
sideNav.searchChannel('general'); |
|
|
|
|
mainContent.channelTitle.getText().should.equal('general'); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
describe('user created channel', () => { |
|
|
|
|
beforeEach(() => { |
|
|
|
|
sideNav.getChannelFromSpotlight(publicChannelName).waitForVisible(5000); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
afterEach(() => { |
|
|
|
|
sideNav.spotlightSearch.setValue(''); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
it('should search the user created channel', () => { |
|
|
|
|
sideNav.getChannelFromSpotlight(publicChannelName).isVisible().should.be.true; |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
it('should go to the user created channel', () => { |
|
|
|
|
sideNav.searchChannel(publicChannelName); |
|
|
|
|
mainContent.channelTitle.getText().should.equal(publicChannelName); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
describe('searching with sideNav channel list', () => { |
|
|
|
|
before(() => { |
|
|
|
|
mainContent.messageInput.click(); |
|
|
|
|
}); |
|
|
|
|
describe('rocket.cat', () => { |
|
|
|
|
it('should show the rocket cat in the direct messages list', () => { |
|
|
|
|
sideNav.getChannelFromList('rocket.cat').isVisible().should.be.true; |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
it('should go to the rocket cat direct message', () => { |
|
|
|
|
sideNav.openChannel('rocket.cat'); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
describe('general', () => { |
|
|
|
|
it('should show the general in the channel list', () => { |
|
|
|
|
sideNav.getChannelFromList('general').isVisible().should.be.true; |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
it('should go to the general channel', () => { |
|
|
|
|
sideNav.openChannel('general'); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
describe('user created channel', () => { |
|
|
|
|
it('should show the user created channel in the channel list', () => { |
|
|
|
|
sideNav.getChannelFromList(publicChannelName).isVisible().should.be.true; |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
it('should go to the user created channel', () => { |
|
|
|
|
sideNav.openChannel(publicChannelName); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
describe('channel usage', ()=> { |
|
|
|
|
before(() => { |
|
|
|
|
sideNav.openChannel(publicChannelName); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
@ -259,4 +357,12 @@ describe('channel usage', ()=> { |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
it.skip('leave the channel', () => { |
|
|
|
|
let channel = sideNav.getChannelFromList('NAME-EDITED-'+publicChannelName); |
|
|
|
|
channel.moveToObject(); |
|
|
|
|
sideNav.channelLeave.waitForVisible(5000); |
|
|
|
|
sideNav.channelLeave.click(); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
|