Skip to content
This repository has been archived by the owner on Mar 13, 2024. It is now read-only.

Commit

Permalink
Fix messaging, plugins, team settings (#5295)
Browse files Browse the repository at this point in the history
* Reset config globally on before hook

* Fix messaging, plugins, team settings specs

* Fix lint and fix other messaging specs

* Modified inviteUser user2
  • Loading branch information
Joseph Baylon committed Apr 9, 2020
1 parent 56badfe commit fc4e532
Show file tree
Hide file tree
Showing 17 changed files with 232 additions and 154 deletions.
1 change: 1 addition & 0 deletions e2e/cypress/fixtures/long_text_post.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
The quick, brown fox jumps over a lazy dog. DJs flock by when MTV ax quiz prog. Junk MTV quiz graced by fox whelps. Bawds jog, flick quartz, vex nymphs. Waltz, bad nymph, for quick jigs vex! Fox nymphs grab quick-jived waltz. Brick quiz whangs jumpy veldt fox. Bright vixens jump; dozy fowl quack. Quick wafting zephyrs vex bold Jim. Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex. Two driven jocks help fax my big quiz. Quick, Baz, get my woven flax jodhpurs! "Now fax quiz Jack!" my brave ghost pled. Five quacking zephyrs jolt my wax bed. Flummoxed by job, kvetching W. zaps Iraq. Cozy sphinx waves quart jug of bad milk. A very bad quack might jinx zippy fowls. Few quips galvanized the mock jury box. Quick brown dogs jump over the lazy fox. The jay, pig, fox, zebra, and my wolves quack! Blowzy red vixens fight for a quick jump. Joaquin Phoenix was gazed by MTV for luck. A wizard’s job is to vex chumps quickly in fog. Watch "Jeopardy!", Alex Trebek's fun TV quiz game. Woven silk pyjamas exchanged for blue quartz. Brawny gods just flocked up to quiz and vex him. Adjusting quiver and bow, Zompyc[1] killed the fox. My faxed joke won a pager in the cable TV quiz show. Amazingly few discotheques provide jukeboxes. My girl wove six dozen plaid jackets before she quit. Six big devils from Japan quickly forgot how to waltz. Big July earthquakes confound zany experimental vow. Foxy parsons quiz and cajole the lovably dim wiki-girl. Have a pick: twenty six letters - no forcing a jumbled quiz! Crazy Fredericka bought many very exquisite opal jewels. Sixty zippers were quickly picked from the woven jute bag. A quick movement of the enemy will jeopardize six gunboats. All questions asked by five watch experts amazed the judge. Jack quietly moved up front and seized the big ball of wax. The quick, brown fox jumps over a lazy dog. DJs flock by when MTV ax quiz prog. Junk MTV quiz graced by fox whelps. Bawds jog, flick quartz, vex nymphs. Waltz, bad nymph, for quick jigs vex! Fox nymphs grab quick-jived waltz. Brick quiz whangs jumpy veldt fox. Bright vixens jump; dozy fowl quack. Quick wafting zephyrs vex bold Jim. Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex. Two driven jocks help fax my big quiz. Quick, Baz, get my woven flax jodhpurs! "Now fax quiz Jack!" my brave ghost pled. Five quacking zephyrs jolt my wax bed. Flummoxed by job, kvetching W. zaps Iraq. Cozy sphinx waves quart jug of bad milk. A very bad quack might jinx zippy fowls. Few quips galvanized the mock jury box. Quick brown dogs jump over the lazy fox. The jay, pig, fox, zebra, and my wolves quack! Blowzy red vixens fight for a quick jump. Joaquin Phoenix was gazed by MTV for luck. A wizard’s job is to vex chumps quickly in fog. Watch "Jeopardy!", Alex Trebek's fun TV quiz game. Woven silk pyjamas exchanged for blue quartz. Brawny gods just flocked up to quiz and vex him. Adjusting quiver and bow, Zompyc[1] killed the fox. My faxed joke won a pager in the cable TV quiz show. Amazingly few discotheques provide jukeboxes. My girl wove six dozen plaid jackets before she quit. Six big devils from Japan quickly forgot how to waltz. Big July earthquakes confound zany experimental vow. Foxy parsons quiz and cajole the lovably dim wiki-girl. Have a pick: twenty six letters - no forcing a jumbled quiz! Crazy Fredericka bought many very exquisite opal jewels. Sixty zippers were quickly picked from the woven jute bag. A quick movement of the enemy will jeopardize six gunboats. All questions asked by five watch experts amazed the judge. Jack quietly moved up front and seized the big ball of wax. The quick, brown fox jumps over a lazy dog. DJs flock by when MTV ax quiz prog. Junk MTV quiz graced by fox whelps. Bawds jog, flick quartz, vex nymphs. Waltz, bad nymph, for quick jigs vex! Fox nymphs grab quick-jived waltz. Brick quiz whangs jumpy veldt fox. Hello this is a long post, with more than 4000 characters, plus multiple attachments.
The quick, brown fox jumps over a lazy dog. DJs flock by when MTV ax quiz prog. Junk MTV quiz graced by fox whelps. Bawds jog, flick quartz, vex nymphs. Waltz, bad nymph, for quick jigs vex! Fox nymphs grab quick-jived waltz. Brick quiz whangs jumpy veldt fox. Bright vixens jump; dozy fowl quack. Quick wafting zephyrs vex bold Jim. Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex. Two driven jocks help fax my big quiz. Quick, Baz, get my woven flax jodhpurs! "Now fax quiz Jack!" my brave ghost pled. Five quacking zephyrs jolt my wax bed. Flummoxed by job, kvetching W. zaps Iraq. Cozy sphinx waves quart jug of bad milk. A very bad quack might jinx zippy fowls. Few quips galvanized the mock jury box. Quick brown dogs jump over the lazy fox. The jay, pig, fox, zebra, and my wolves quack! Blowzy red vixens fight for a quick jump. Joaquin Phoenix was gazed by MTV for luck. A wizard’s job is to vex chumps quickly in fog. Watch "Jeopardy!", Alex Trebek's fun TV quiz game. Woven silk pyjamas exchanged for blue quartz. Brawny gods just flocked up to quiz and vex him. Adjusting quiver and bow, Zompyc[1] killed the fox. My faxed joke won a pager in the cable TV quiz show. Amazingly few discotheques provide jukeboxes. My girl wove six dozen plaid jackets before she quit. Six big devils from Japan quickly forgot how to waltz. Big July earthquakes confound zany experimental vow. Foxy parsons quiz and cajole the lovably dim wiki-girl. Have a pick: twenty six letters - no forcing a jumbled quiz! Crazy Fredericka bought many very exquisite opal jewels. Sixty zippers were quickly picked from the woven jute bag. A quick movement of the enemy will jeopardize six gunboats. All questions asked by five watch experts amazed the judge. Jack quietly moved up front and seized the big ball of wax. The quick, brown fox jumps over a lazy dog. DJs flock by when MTV ax quiz prog. Junk MTV quiz graced by fox whelps. Bawds jog, flick quartz, vex nymphs. Waltz, bad nymph, for quick jigs vex! Fox nymphs grab quick-jived waltz. Brick quiz whangs jumpy veldt fox. Bright vixens jump; dozy fowl quack. Quick wafting zephyrs vex bold Jim. Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex. Two driven jocks help fax my big quiz. Quick, Baz, get my woven flax jodhpurs! "Now fax quiz Jack!" my brave ghost pled. Five quacking zephyrs jolt my wax bed. Flummoxed by job, kvetching W. zaps Iraq. Cozy sphinx waves quart jug of bad milk. A very bad quack might jinx zippy fowls. Few quips galvanized the mock jury box. Quick brown dogs jump over the lazy fox. The jay, pig, fox, zebra, and my wolves quack! Blowzy red vixens fight for a quick jump. Joaquin Phoenix was gazed by MTV for luck. A wizard’s job is to vex chumps quickly in fog. Watch "Jeopardy!", Alex Trebek's fun TV quiz game. Woven silk pyjamas exchanged for blue quartz. Brawny gods just flocked up to quiz and vex him. Adjusting quiver and bow, Zompyc[1] killed the fox. My faxed joke won a pager in the cable TV quiz show. Amazingly few discotheques provide jukeboxes. My girl wove six dozen plaid jackets before she quit. Six big devils from Japan quickly forgot how to waltz. Big July earthquakes confound zany experimental vow. Foxy parsons quiz and cajole the lovably dim wiki-girl. Have a pick: twenty six letters - no forcing a jumbled quiz! Crazy Fredericka bought many very exquisite opal jewels. Sixty zippers were quickly picked from the woven jute bag. A quick movement of the enemy will jeopardize six gunboats. All questions asked by five watch experts amazed the judge. Jack quietly moved up front and seized the big ball of wax. The quick, brown fox jumps over a lazy dog. DJs flock by when MTV ax quiz prog. Junk MTV quiz graced by fox whelps. Bawds jog, flick quartz, vex nymphs. Waltz, bad nymph, for quick jigs vex! Fox nymphs grab quick-jived waltz. Brick quiz whangs jumpy veldt fox. Hello this is a long post, with more than 4000 characters, plus multiple attachments.
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,31 @@
import * as TIMEOUTS from '../../fixtures/timeouts';

describe('Messaging', () => {
before(() => {
// # Make sure for second user, unread channels are grouped
let testChannel;

beforeEach(() => {
testChannel = null;

// # Login as sysadmin
cy.apiLogin('sysadmin');

// # Reset Sidebar Setting Preference
cy.apiSaveSidebarSettingPreference();

// # Login and go to /
// # Login as user-1
cy.apiLogin('user-1');

// # Visit the Town Square channel
cy.visit('/ad-1/town-square');
});

afterEach(() => {
cy.apiLogin('sysadmin');
if (testChannel && testChannel.id) {
cy.apiDeleteChannel(testChannel.id);
}
});

it('M18713-Channel is removed from Unreads section if user navigates out of it via permalink', () => {
const message = 'Hello' + Date.now();
let linkText;
Expand Down Expand Up @@ -64,7 +79,7 @@ describe('Messaging', () => {

// # Create public channel to post permalink
cy.apiCreateChannel(teamId, channelName, channelName, 'O', 'Test channel').then((response) => {
const testChannel = response.body;
testChannel = response.body;

// # Post the message on the channel
postMessageOnChannel(testChannel, linkText);
Expand Down
22 changes: 15 additions & 7 deletions e2e/cypress/integration/messaging/collapse_link_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,31 @@
// Group: @messaging

describe('Messaging', () => {
before(() => {
// # Login as sysadmin and update preference
beforeEach(() => {
// # Login as sysadmin
cy.apiLogin('sysadmin');
cy.apiSaveShowPreviewPreference();
cy.apiSavePreviewCollapsedPreference('false');

// # Set the configuration on Link Previews
// # Enable Link Previews
cy.apiUpdateConfig({
ServiceSettings: {
EnableLinkPreviews: true,
},
});

// # Login as user-1, update preference and go to town-square
// # Save Show Preview Preference to true
// # Save Preview Collapsed Preference to false
cy.apiSaveShowPreviewPreference('true');
cy.apiSavePreviewCollapsedPreference('false');

// # Login as user-1
cy.apiLogin('user-1');
cy.apiSaveShowPreviewPreference();

// # Save Show Preview Preference to true
// # Save Preview Collapsed Preference to false
cy.apiSaveShowPreviewPreference('true');
cy.apiSavePreviewCollapsedPreference('false');

// # Visit the Town Square channel
cy.visit('/ad-1/channels/town-square');
});

Expand Down
6 changes: 3 additions & 3 deletions e2e/cypress/integration/messaging/collapsed_message_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@

function verifyCollapsedPost() {
// * Verify show more button
cy.get('#showMoreButton').scrollIntoView().should('be.visible').and('have.text', 'Show More');
cy.get('#showMoreButton').scrollIntoView().should('be.visible').and('have.text', 'Show more');

// * Verify gradient
cy.get('#collapseGradient').should('be.visible');
}

function verifyExpandedPost() {
// * Verify show more button now says 'Show Less'
cy.get('#showMoreButton').scrollIntoView().should('be.visible').and('have.text', 'Show Less');
// * Verify show more button now says 'Show less'
cy.get('#showMoreButton').scrollIntoView().should('be.visible').and('have.text', 'Show less');

// * Verify gradient
cy.get('#collapseGradient').should('be.not.visible');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,20 @@
// Group: @messaging

describe('MM-13064 - Emoji picker keyboard usability', () => {
before(() => {
// # Login as "user-1" and go to /
beforeEach(() => {
// # Login as user-1
cy.apiLogin('user-1');

// # Visit the Town Square channel
cy.visit('/ad-1/channels/town-square');
});

beforeEach(() => {
// # Open emoji picker
cy.get('#emojiPickerButton').click();

// # Wait for emoji picker to load
cy.get('#emojiPicker').should('be.visible');
});

afterEach(() => {
// # Close emoji picker by clicking on body
cy.get('body').click();
});

it('If the left arrow key is pressed while focus is on the emoji picker text box, the cursor should move left in the text', () => {
cy.findByLabelText('Search for an emoji').
should('be.visible').
Expand Down
27 changes: 18 additions & 9 deletions e2e/cypress/integration/messaging/focus_move_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,20 +49,31 @@ function verifyFocusInAddChannelMemberModal() {
}

describe('Messaging', () => {
before(() => {
cy.apiLogin('user-1');
});
let testChannel;

beforeEach(() => {
testChannel = null;

// # Login as user-1
cy.apiLogin('user-1');

// # Visit the Town Square channel
cy.visit('/ad-1/channels/town-square');
});

afterEach(() => {
cy.apiLogin('sysadmin');
if (testChannel && testChannel.id) {
cy.apiDeleteChannel(testChannel.id);
}
});

it('M15406 - Focus move from Recent Mentions to main input box when a character key is selected', () => {
//#Click the flag icon to open the flagged posts RHS to move the focus out of the main input box
cy.get('#channelHeaderFlagButton').click();

//#Making sure Flagged Posts is present on the page
cy.contains('Flagged Posts').should('be.visible');
cy.get('#searchContainer', {timeout: TIMEOUTS.SMALL}).contains('Flagged Posts').should('be.visible');
cy.get('#post_textbox').should('not.be.focused');

//#Push a character key such as "A"
Expand Down Expand Up @@ -133,18 +144,16 @@ describe('Messaging', () => {
});

it('M17452 Focus does not move when it has already been set elsewhere', () => {
let channel;

cy.getCurrentTeamId().then((teamId) => {
// # Create new test channel
cy.apiCreateChannel(teamId, 'channel-test', 'Channel Test').then((res) => {
channel = res.body;
testChannel = res.body;

// # Select the channel on the left hand side
cy.get(`#sidebarItem_${channel.name}`).click({force: true});
cy.get(`#sidebarItem_${testChannel.name}`).click({force: true});

// * Channel's display name should be visible at the top of the center pane
cy.get('#channelHeaderTitle').should('contain', channel.display_name);
cy.get('#channelHeaderTitle').should('contain', testChannel.display_name);

// # Verify Focus in add channel member modal
verifyFocusInAddChannelMemberModal();
Expand Down
18 changes: 15 additions & 3 deletions e2e/cypress/integration/messaging/header_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,28 @@
import * as TIMEOUTS from '../../fixtures/timeouts';

describe('Header', () => {
before(() => {
// # Login and go to /
let testTeam;

beforeEach(() => {
testTeam = null;

// # Login as user-1
cy.apiLogin('user-1');

// # Create new test team
cy.apiCreateTeam('test-team', 'Test Team').then((response) => {
testTeam = response.body;
cy.visit(`/${response.body.name}`);
});
});

afterEach(() => {
cy.apiLogin('sysadmin');
if (testTeam && testTeam.id) {
cy.apiDeleteTeam(testTeam.id);
}
});

it('M13564 Ellipsis indicates the channel header is too long', () => {
// * Verify with short channel header
updateAndVerifyChannelHeader('>', 'newheader');
Expand Down Expand Up @@ -58,7 +70,7 @@ describe('Header', () => {
cy.get('#header-popover > div.popover-content').
should('have.html', `<span><blockquote>\n<p>${header}</p>\n</blockquote></span>`);

cy.apiSaveMessageDisplayPreference();
cy.apiSaveMessageDisplayPreference('clean');
});

it('S13483 - Cleared search term should not reappear as RHS is opened and closed', () => {
Expand Down
66 changes: 41 additions & 25 deletions e2e/cypress/integration/messaging/long_post_attachments_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
// Stage: @prod
// Group: @messaging

let team;

function verifyImageInPostFooter(verifyExistence = true) {
if (verifyExistence) {
// * Verify that the image exists in the post message footer
Expand All @@ -24,39 +22,53 @@ function verifyImageInPostFooter(verifyExistence = true) {
}
}

function postAttachments() {
// Add 4 attachments to a post
[...Array(4)].forEach(() => {
cy.fileUpload('#fileUploadInput', 'small-image.png');
});

// # verify the attachment at the footer
verifyImageInPostFooter();

// # Copy and paste the text below into the message box and post
cy.fixture('long_text_post.txt', 'utf-8').then((text) => {
cy.get('#post_textbox').then((textbox) => {
textbox.val(text);
}).type(' {backspace}{enter}');
});
}

describe('M14322 Long post with multiple attachments', () => {
before(() => {
let testTeam;

beforeEach(() => {
testTeam = null;

// # Login as sysadmin
cy.apiLogin('sysadmin');

// # Login as new user
cy.apiCreateAndLoginAsNewUser().then(() => {
// # Create new team and visit its URL
cy.apiCreateTeam('test-team', 'Test Team').then((response) => {
team = response.body;
cy.visit(`/${team.name}`);
});
// # Create new team and new user and visit Town Square channel
cy.apiCreateTeam('test-team', 'Test Team').then((response) => {
testTeam = response.body;
cy.apiCreateAndLoginAsNewUser({}, [testTeam.id]);
cy.visit(`/${testTeam.name}/channels/town-square`);
});
});

it('Attachment previews/thumbnails display as expected, when viewing full or partial post', () => {
// Add 4 attachments to a post
[...Array(4)].forEach(() => {
cy.fileUpload('#fileUploadInput', 'small-image.png');
});

// # verify the attachment at the footer
verifyImageInPostFooter();
afterEach(() => {
cy.apiLogin('sysadmin');
if (testTeam && testTeam.id) {
cy.apiDeleteTeam(testTeam.id);
}
});

// # Copy and paste the text below into the message box and post
cy.fixture('long_text_post.txt', 'utf-8').then((text) => {
cy.get('#post_textbox').then((textbox) => {
textbox.val(text);
}).type(' {backspace}{enter}');
});
it('Attachment previews/thumbnails display as expected, when viewing full or partial post', () => {
// # Post attachments
postAttachments();

// * Verify show more button
cy.get('#showMoreButton').scrollIntoView().should('be.visible').and('have.text', 'Show More');
cy.get('#showMoreButton').scrollIntoView().should('be.visible').and('have.text', 'Show more');

// * Verify gradient
cy.get('#collapseGradient').should('be.visible');
Expand All @@ -74,6 +86,10 @@ describe('M14322 Long post with multiple attachments', () => {
});

it('Can click one of the attachments and cycle through the multiple attachment previews as usual', () => {
// # Post attachments
postAttachments();

// * Verify the attached items can be cycled through
cy.getLastPostId().then((postID) => {
cy.get(`#${postID}_message`).findByTestId('fileAttachmentList').children().first().click();

Expand Down
Loading

0 comments on commit fc4e532

Please sign in to comment.