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

MM-14391 Reorganize command to reset account settings via API and separate API and UI commands #2600

Merged
merged 2 commits into from
Apr 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion components/post_view/post/post.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,10 @@ export default class Post extends React.PureComponent {
onMouseLeave={this.unsetHover}
onTouchStart={this.setHover}
>
<div className={'post__content ' + centerClass}>
<div
id='postContent'
className={'post__content ' + centerClass}
>
<div className='post__img'>
{profilePic}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,15 @@

describe('Account Settings > Display > Channel Display Mode', () => {
before(() => {
cy.login('user-1');
cy.apiLogin('user-1');

// 1. Set default preference of a user on channel and message display
cy.updateChannelDisplayModePreference('centered');
cy.updateMessageDisplayPreference();
cy.apiSaveChannelDisplayModePreference('centered');
cy.apiSaveMessageDisplayPreference();

// Post a message to a channel
cy.visit('/');
cy.postMessage('Test for channel display mode {enter}');
});

beforeEach(() => {
Expand Down Expand Up @@ -76,9 +80,9 @@ describe('Account Settings > Display > Channel Display Mode', () => {
// 8. Go to channel which has any posts
cy.get('#sidebarItem_town-square').click();

// * Validate if the post content in center channel is fulled.
// * 1179px is fulled width when the viewport width is 1500px
cy.get('.post__content').last().should('have.css', 'width', '1179px');
// * Validate if the post content in center channel is full width
// by checking the exact class name.
cy.get('#postContent').first().invoke('attr', 'class').should('contain', 'post__content').should('not.contain', 'center');
});

it('AS13225 Channel display mode setting to "Fixed width, centered"', () => {
Expand Down Expand Up @@ -113,22 +117,8 @@ describe('Account Settings > Display > Channel Display Mode', () => {
// 8. Go to channel which has any posts
cy.get('#sidebarItem_town-square').click();

//* Validate if the post content in center channel is fixed and centered
cy.get('.post__content').last().should('have.css', 'width', '1000px');
cy.get('.post__content').last().should('have.class', 'center');
});

it('Width of center view when message display is compact and channel display mode is either centered or full', () => {
// 1. Set message display to compact with channel display mode set to centered
cy.updateMessageDisplayPreference('compact');

// * Verify that the width is at 1000px
cy.get('.post__content').last().should('have.css', 'width', '1000px');

// 2. Set channel display mode to full (default) with message display in compact
cy.updateChannelDisplayModePreference();

// * Verify that the width is at 1123px
cy.get('.post__content').last().should('have.css', 'width', '1123px');
// * Validate if the post content in center channel is fixed and centered
// by checking the exact class name.
cy.get('#postContent').first().invoke('attr', 'class').should('contain', 'post__content center');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function navigateToThemeSettings() {
describe('AS14319 Theme Colors - Code', () => {
before(() => {
// 1. Login and navigate to the app
cy.login('user-1');
cy.apiLogin('user-1');
cy.visit('/');

// 2. Enter in code block for message
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ const testCases = [
describe('AS14318 Theme Colors - Color Picker', () => {
before(() => {
// 1. Set default theme preference
cy.updateThemePreference();
cy.apiSaveThemePreference();
});

after(() => {
// * Revert to default theme preference
cy.updateThemePreference();
cy.apiSaveThemePreference();
});

it('Theme Display should render in min setting view', () => {
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/at_mentions/at_mentions_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ describe('at-mention', () => {

// 1. Login and navigate to the app
cy.get('@receiver').then((receiver) => {
cy.login(receiver.username);
cy.apiLogin(receiver.username);
});

cy.visit('/');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
describe('Identical Message Drafts', () => {
before(() => {
// 1. Login and go to /
cy.login('user-1');
cy.apiLogin('user-1');
cy.visit('/');

// 2. Clear channel textbox
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/channel/collapsed_message_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function verifyExpandedPost() {
describe('Long message', () => {
it('M14321 will show more/less content correctly', () => {
// 1. Login as "user-1" and go to /
cy.login('user-1');
cy.apiLogin('user-1');
cy.visit('/');

// 2. Post message with kitchen sink markdown text
Expand Down
4 changes: 2 additions & 2 deletions cypress/integration/channel/edit_message_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
describe('Edit Message', () => {
it('M13909 Escape should not close modal when an autocomplete drop down is in use', () => {
// 1. Login as "user-1" and go to /
cy.login('user-1');
cy.apiLogin('user-1');
cy.visit('/');

// 2. Post message "Hello"
Expand Down Expand Up @@ -66,7 +66,7 @@ describe('Edit Message', () => {

it('M13482 Display correct timestamp for edited message', () => {
// 1. Login as "user-1" and go to /
cy.login('user-1');
cy.apiLogin('user-1');
cy.visit('/');

// 2. Post a message
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/channel/header_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
describe('Header', () => {
before(() => {
// 1. Login and go to /
cy.login('user-1');
cy.apiLogin('user-1');
cy.visit('/');
});

Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/channel/message_bullets_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
describe('Message', () => {
it('M13326 Text in bullet points is the same size as text above and below it', () => {
// 1. Login and navigate to the app
cy.login('user-1');
cy.apiLogin('user-1');
cy.visit('/');

// 2. Enter in text
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/channel/message_draft_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
describe('Message Draft', () => {
before(() => {
// 1. Login and go to /
cy.login('user-1');
cy.apiLogin('user-1');
cy.visit('/');
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
describe('Message Draft and Switch Channels', () => {
before(() => {
// 1. Login and go to /
cy.login('user-1');
cy.apiLogin('user-1');
cy.visit('/');
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
describe('MM-13697 Edit Post with attachment', () => {
before(() => {
// 1. Login and go to /
cy.login('user-1');
cy.apiLogin('user-1');
cy.visit('/');
});

Expand Down
8 changes: 4 additions & 4 deletions cypress/integration/channel/message_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
describe('Message', () => {
it('M13701 Consecutive message does not repeat profile info', () => {
// 1. Login as sysadmin and go to /
cy.login('sysadmin');
cy.apiLogin('sysadmin');
cy.visit('/');

// 2. Post a message to force next user message to display a message
cy.postMessage('Hello');

// 3. Login as "user-1" and go to /
cy.login('user-1');
cy.apiLogin('user-1');
cy.visit('/');

// 4. Post message "One"
Expand All @@ -43,7 +43,7 @@ describe('Message', () => {

it('M14012 Focus move to main input box when a character key is selected', () => {
// 1. Login and go to /
cy.login('user-1');
cy.apiLogin('user-1');
cy.visit('/');

// 2. Post message
Expand Down Expand Up @@ -73,7 +73,7 @@ describe('Message', () => {

it('M14320 @here., @all. and @channel. (ending in a period) still highlight', () => {
// 1. Login and go to /
cy.login('user-1');
cy.apiLogin('user-1');
cy.visit('/');

// 2. Post message
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/channel/system_message_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ function getLines(e) {
describe('System Message', () => {
before(() => {
// 1. Login and go to /
cy.login('user-1');
cy.apiLogin('user-1');
cy.visit('/');
cy.updateTeammateDisplayModePreference();
});
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/login/login_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

describe('Login page', () => {
before(() => {
cy.logoutByAPI();
cy.apiLogout();

// 1. Go to login page
cy.visit('/login');
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/markdown/markdown_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const testCases = [
describe('Markdown message', () => {
before(() => {
// 1. Login as "user-1" and go to /
cy.login('user-1');
cy.apiLogin('user-1');
cy.visit('/');
});

Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/search/results_post_comment_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
describe('Search', () => {
it('S14548 Search results Right-Hand-Side: Post a comment', () => {
// 1. Login and navigate to the app
cy.login('user-1');
cy.apiLogin('user-1');
cy.visit('/');

const message = `asparagus-${Date.now()}`;
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/team/create_a_team_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {getRandomInt} from '../../utils';
describe('Teams Suite', () => {
before(() => {
// 1. Login and go to /
cy.login('user-1');
cy.apiLogin('user-1');
cy.visit('/');
});

Expand Down
6 changes: 3 additions & 3 deletions cypress/integration/team/teams_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import users from '../../fixtures/users.json';
describe('Teams Suite', () => {
it('TS12995 Cancel out of leaving a team', () => {
// 1. Login and go to /
cy.login('user-1');
cy.apiLogin('user-1');
cy.visit('/');

// * check the team name
Expand Down Expand Up @@ -56,7 +56,7 @@ describe('Teams Suite', () => {
const offTopicURL = `/${teamURL}/channels/off-topic`;

// 1. Login as System Admin
cy.login('sysadmin');
cy.apiLogin('sysadmin');
cy.visit('/');

// 2. Create team
Expand Down Expand Up @@ -93,7 +93,7 @@ describe('Teams Suite', () => {
cy.logout();

// 8. Login as user added to Team
cy.login(user.username);
cy.apiLogin(user.username);

// * The added user sees the new team added to the team sidebar
cy.get(`#${teamURL}TeamButton`).should('have.attr', 'href').should('contain', teamURL);
Expand Down
Loading