[ACS-5703] Comment List code and styles cleanup (#8787)

* remove useless locale

* remove useless id values, update tests

* code cleanup

* fix formatting

* css cleanup

* code cleanup

* style cleanup

* fix css scope

* cleanup styles

* remove sanitise and don't bind to innerHTML

* reduce ng-container

* move model specific logic to Comment Model

* update tests, remove sanitise tests

* drop carma coverage to 72 as code removed

* drop selection animation as selection operations are not supported by the component itself

* cleanup css

* fix tests and lint

* update stories and tests

* fix line breaks

* move e2e to unit test

* disable search tests

* disable search tests

* disable search tests
This commit is contained in:
Denys Vuika
2023-07-31 19:23:46 +01:00
committed by GitHub
parent 312562889c
commit 3f3e83057d
21 changed files with 237 additions and 401 deletions

View File

@@ -32,17 +32,17 @@ import CONSTANTS = require('../../util/constants');
import { SitesApi, SiteEntry, CommentsApi } from '@alfresco/js-api';
describe('Comment', () => {
const loginPage: LoginPage = new LoginPage();
const contentServicesPage: ContentServicesPage = new ContentServicesPage();
const viewerPage: ViewerPage = new ViewerPage();
const commentsPage: CommentsPage = new CommentsPage();
const loginPage = new LoginPage();
const contentServicesPage = new ContentServicesPage();
const viewerPage = new ViewerPage();
const commentsPage = new CommentsPage();
const navigationBarPage = new NavigationBarPage();
const apiService = createApiService();
const commentsApi = new CommentsApi(apiService.getInstance());
let userFullName; let nodeId;
let userFullName: string;
let nodeId: string;
let acsUser: UserModel;
const pngFileModel = new FileModel({
@@ -57,11 +57,6 @@ describe('Comment', () => {
first: 'This is a comment',
multiline: 'This is a comment\n' + 'with a new line',
second: 'This is another comment',
codeType: `<form action="/action_page.php">
First name: <input type="text" name="fname"><br>
Last name: <input type="text" name="lname"><br>
<input type="submit" value="Submit">
</form>`,
test: 'Test'
};
@@ -149,22 +144,6 @@ describe('Comment', () => {
await expect(await commentsPage.getUserName(0)).toEqual(userFullName);
await expect(await commentsPage.getTime(0)).toMatch(/(ago|few)/);
});
it('[C280022] Should treat HTML code as a regular string', async () => {
const resultStr = comments.codeType.replace(/\s\s+/g, ' ');
await viewerPage.viewFile(pngFileModel.name);
await viewerPage.clickInfoButton();
await viewerPage.checkInfoSideBarIsDisplayed();
await viewerPage.clickOnCommentsTab();
await commentsPage.addComment(comments.codeType);
await commentsPage.checkUserIconIsDisplayed();
await commentsPage.getTotalNumberOfComments('Comments (1)');
await expect(await commentsPage.getMessage(0)).toEqual(resultStr);
await expect(await commentsPage.getUserName(0)).toEqual(userFullName);
await expect(await commentsPage.getTime(0)).toMatch(/(ago|few)/);
});
});
describe('Consumer Permissions', () => {

View File

@@ -13,5 +13,13 @@
"C280063": "https://alfresco.atlassian.net/browse/ACS-4595",
"C280064": "https://alfresco.atlassian.net/browse/ACS-4595",
"C280407": "https://alfresco.atlassian.net/browse/ACS-4595",
"C277288": "https://alfresco.atlassian.net/browse/AAE-15475"
"C277288": "https://alfresco.atlassian.net/browse/AAE-15475",
"C280054": "https://alfresco.atlassian.net/browse/ACS-5742",
"C280058": "https://alfresco.atlassian.net/browse/ACS-5742",
"C286298": "https://alfresco.atlassian.net/browse/ACS-5742",
"C277146": "https://alfresco.atlassian.net/browse/ACS-5742",
"C286556": "https://alfresco.atlassian.net/browse/ACS-5742",
"C291802": "https://alfresco.atlassian.net/browse/ACS-5742",
"C277280": "https://alfresco.atlassian.net/browse/ACS-5742",
"C277281": "https://alfresco.atlassian.net/browse/ACS-5742"
}