Files
upstream-mirror 240db4e2a7
Some checks failed
Server CI / Postgres (shard 0) (push) Has been skipped
Server CI / Postgres (shard 3) (push) Has been skipped
BuildEnv Docker Image / build-image (push) Failing after 4s
BuildEnv Docker Image / build-image-fips (push) Failing after 4s
Migration Review & Release Notes / Generate migration review & release notes (push) Failing after 3s
Server CI / Build Environment (push) Failing after 3s
Server CI / Postgres (shard 1) (push) Has been skipped
Tools CI / check-style (mattermost-govet) (push) Failing after 4s
Server CI / Postgres (shard 2) (push) Has been skipped
Tools CI / check-style (mmgotool) (push) Failing after 3s
Server CI / Elasticsearch v8 Compatibility (push) Has been skipped
Server CI / OpenSearch v2 Compatibility (push) Has been skipped
Server CI / Postgres FIPS (shard 0) (push) Has been skipped
Tools CI / Test (mattermost-govet) (push) Failing after 3s
Server CI / Postgres FIPS (shard 1) (push) Has been skipped
Server CI / Postgres FIPS (shard 2) (push) Has been skipped
Tools CI / Test (mmgotool) (push) Failing after 3s
Server CI / Postgres FIPS (shard 3) (push) Has been skipped
Server CI / Run mmctl tests (push) Has been skipped
Server CI / Run mmctl tests (FIPS) (push) Has been skipped
Server CI / Merge Postgres Test Results (push) Has been skipped
Server CI / Merge Postgres FIPS Test Results (push) Has been skipped
Server CI / Check backport migrations (push) Has been skipped
Server CI / Check generated files (push) Has been skipped
Server CI / check-style (push) Has been skipped
Server CI / Vet API (push) Has been skipped
Server CI / Build mattermost server app (push) Has been skipped
Server CI / Server CI Complete (push) Failing after 2s
Server CI / Server CI Artifacts (push) Has been skipped
Server CI / Sentry Upload (push) Has been skipped
Server CI / Server CI Report (push) Failing after 5m1s
Server CI Nightly Race / Race Detector (push) Has been skipped
CodeQL / Analyze (go) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
Webapp CI Cache Warm / Warm Webapp node_modules Cache (push) Has been cancelled
E2E CI Cache Warm / Warm E2E npm Registry Cache (push) Has been cancelled
API / build (push) Has been cancelled
Web App CI / check-types (push) Has been cancelled
Web App CI / check-lint (push) Has been cancelled
Web App CI / check-i18n (push) Has been cancelled
Web App CI / check-external-links (push) Has been cancelled
Web App CI / test (platform) (push) Has been cancelled
Web App CI / test (mattermost-redux) (push) Has been cancelled
Web App CI / test (channels shard 1/4) (push) Has been cancelled
Web App CI / test (channels shard 2/4) (push) Has been cancelled
Web App CI / test (channels shard 3/4) (push) Has been cancelled
Web App CI / test (channels shard 4/4) (push) Has been cancelled
Web App CI / upload-coverage (push) Has been cancelled
Web App CI / build (push) Has been cancelled
YAML Lint / yamllint (push) Has been cancelled
Push mirrored docker images / cd/Push mirrored docker images (push) Has been cancelled
docs-cd / Build and deploy docs (push) Has been cancelled
Docs CI / build (push) Has been cancelled
E2E Cache Warm: Cypress deps / Warm Cypress deps cache (push) Has been cancelled
Scorecards supply-chain security / Scorecard analysis (push) Has been cancelled
Server CI Weekly / Postgres FIPS (push) Has been skipped
Server CI Weekly / Run mmctl tests (FIPS) (push) Has been skipped
Server CI Weekly / Postgres with binary parameters (push) Has been skipped
Server CI Weekly / Build Environment (push) Failing after 1s
Server CI Cache Warm / Warm Go Module and Build Cache (push) Failing after 2s
Server CI Nightly Race / Build Environment (push) Failing after 1s
snapshot of https://github.com/mattermost/mattermost.git (master, 2026-09-16; blobs > 131072B omitted)
2026-09-16 00:29:55 +05:00

174 lines
7.0 KiB
JavaScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
// ***************************************************************
// - [#] indicates a test step (e.g. # Go to a page)
// - [*] indicates an assertion (e.g. * Check the title)
// - Use element ID when selecting an element. Create one if none.
// ***************************************************************
// Stage: @prod
// Group: @channels @messaging
import * as TIMEOUTS from '@/fixtures/timeouts';
describe('Post Header', () => {
let testTeam;
before(() => {
// # Login as test user and visit town-square channel
cy.apiInitSetup({loginAfter: true}).then(({team}) => {
testTeam = team;
cy.visit(`/${testTeam.name}/channels/off-topic`);
});
});
beforeEach(() => {
cy.visit(`/${testTeam.name}/channels/off-topic`);
});
it('should render permalink view on click of post timestamp at center view', () => {
// # Post a message
cy.postMessage('test for permalink');
cy.getLastPostId().then((postId) => {
const divPostId = `#post_${postId}`;
// * Check initial state that the first message posted is not highlighted
cy.get(divPostId).should('be.visible').should('not.have.class', 'post--highlight');
// # Click timestamp of a post
cy.clickPostTime(postId);
// * Check if url include the permalink
cy.url().should('include', `/${testTeam.name}/channels/off-topic/${postId}`);
// * Check that the post is highlighted on permalink view
cy.get(divPostId).should('be.visible').and('have.class', 'post--highlight');
// * Check if url redirects back to parent path eventually
cy.url({timeout: TIMEOUTS.TEN_SEC}).should('include', `/${testTeam.name}/channels/off-topic`).and('not.include', `/${postId}`);
// * Check that the highlight is removed after redirect
cy.get(divPostId).should('be.visible').and('not.have.class', 'post--highlight');
});
});
it('should open dropdown menu on click of dot menu icon', () => {
// # Post a message
cy.postMessage('test for dropdown menu');
cy.getLastPostId().then((postId) => {
// * Check that the center dot menu' button and dropdown are hidden
cy.get(`#post_${postId}`).should('be.visible');
cy.get(`#CENTER_button_${postId}`).should('not.be.visible');
cy.get(`#CENTER_dropdown_${postId}`).should('not.exist');
// # Click dot menu of a post
cy.clickPostDotMenu(postId);
// * Check that the center dot menu button and dropdown are visible
cy.get(`#post_${postId}`).should('be.visible');
cy.get(`#CENTER_button_${postId}`).should('be.visible');
cy.get('body').type('{esc}');
// # Click to other location like post textbox
cy.uiGetPostTextBox().click();
// * Check that the center dot menu and dropdown are hidden
cy.get(`#post_${postId}`).should('be.visible');
cy.get(`#CENTER_button_${postId}`).should('not.be.visible');
cy.get(`#CENTER_dropdown_${postId}`).should('not.exist');
});
});
it('should open and close Emoji Picker on click of reaction icon', () => {
// # Post a message
cy.postMessage('test for reaction and emoji picker');
cy.getLastPostId().then((postId) => {
// * Check that the center post reaction icon and emoji picker are not visible
cy.get(`#CENTER_reaction_${postId}`).should('not.be.visible');
cy.get('#emojiPicker').should('not.exist');
// # Click the center post reaction icon of the post
cy.clickPostReactionIcon(postId);
// * Check that the center post reaction icon of the post becomes visible
cy.get(`#CENTER_reaction_${postId}`).should('be.visible').and('have.class', 'post-menu__item--active').and('have.class', 'post-menu__item--reactions');
// * Check that the emoji picker becomes visible as well
cy.get('#emojiPicker').should('be.visible');
// # Click again the center post reaction icon of the post
cy.clickPostReactionIcon(postId);
// # Click on textbox to focus away from emoji area
cy.uiGetPostTextBox().click();
// * Check that the center post reaction icon and emoji picker are not visible
cy.get(`#CENTER_reaction_${postId}`).should('not.be.visible');
cy.get('#emojiPicker').should('not.exist');
});
});
it('should open RHS on click of comment icon and close on RHS\' close button', () => {
// # Post a message
cy.postMessage('test for opening and closing RHS');
// # Open RHS on hover to a post and click to its comment icon
cy.clickPostCommentIcon();
// * Check that the RHS is open
cy.get('#rhsContainer').should('be.visible');
// # Close RHS on click of close button
cy.uiCloseRHS();
// * Check that the RHS is close
cy.get('#rhsContainer').should('not.exist');
});
it('MM-T122 Visual verification of "Searching" animation for Saved and Pinned posts', () => {
cy.delayRequestToRoutes(['pinned', 'flagged'], 5000);
cy.reload();
// Pin and save last post before clicking on Pinned and Saved post icons
cy.postMessage('Post');
//Pin and save the posted message
cy.getLastPostId().then((postId) => {
cy.clickPostDotMenu(postId);
cy.get(`#pin_post_${postId}`).click();
cy.clickPostSaveIcon(postId);
});
// # Click on the "Pinned Posts" icon to the left of the "Search" box
cy.uiGetChannelPinButton().click();
// * Verify that the RHS for pinned posts is opened.
cy.get('#searchContainer').should('be.visible').within(() => {
// * Check that searching indicator appears before the pinned posts are loaded
cy.get('#loadingSpinner', {timeout: TIMEOUTS.FIVE_SEC}).should('be.visible').and('have.text', 'Searching...');
cy.get('#search-items-container').should('be.visible');
// # Close the RHS
cy.get('#searchResultsCloseButton').should('be.visible').click();
});
// # Click on the "Saved Posts" icon to the right of the "Search" box
cy.uiGetSavedPostButton().click();
// * Verify that the RHS for saved posts is opened.
cy.get('#searchContainer').should('be.visible').within(() => {
// * Check that searching indicator appears before the pinned posts are loaded
cy.get('#loadingSpinner').should('be.visible').and('have.text', 'Searching...');
cy.get('#search-items-container').should('be.visible');
// # Close the RHS
cy.get('#searchResultsCloseButton').should('be.visible').click();
});
});
});