mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-31 17:38:28 +00:00
Prettier upgrade and e2e type checks (#1522)
* upgrade prettier * noImplicitAny rule * fix type * update tsconfig * upgrade to 150 print width
This commit is contained in:
@@ -23,35 +23,35 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {
|
||||
LoginPage,
|
||||
BrowsingPage,
|
||||
RepoClient,
|
||||
InfoDrawer,
|
||||
Utils
|
||||
} from '@alfresco/aca-testing-shared';
|
||||
|
||||
import * as moment from 'moment';
|
||||
import { LoginPage, BrowsingPage, RepoClient, InfoDrawer, Utils } from '@alfresco/aca-testing-shared';
|
||||
const moment = require('moment');
|
||||
|
||||
describe('Comments', () => {
|
||||
const username = `user1-${Utils.random()}`;
|
||||
|
||||
const parent = `parent-${Utils.random()}`; let parentId;
|
||||
const parent = `parent-${Utils.random()}`;
|
||||
let parentId: string;
|
||||
|
||||
const file1 = `file1-${Utils.random()}.txt`;
|
||||
const folder1 = `folder1-${Utils.random()}`;
|
||||
const folder2 = `folder2-${Utils.random()}`; let folder2Id;
|
||||
const folder2 = `folder2-${Utils.random()}`;
|
||||
let folder2Id: string;
|
||||
|
||||
const fileWith1Comment = `file1Comment-${Utils.random()}.txt`; let fileWith1CommentId;
|
||||
const fileWith2Comments = `file2Comments-${Utils.random()}.txt`; let fileWith2CommentsId;
|
||||
const fileWith1Comment = `file1Comment-${Utils.random()}.txt`;
|
||||
let fileWith1CommentId: string;
|
||||
const fileWith2Comments = `file2Comments-${Utils.random()}.txt`;
|
||||
let fileWith2CommentsId: string;
|
||||
|
||||
const file2Personal = `file2Personal-${Utils.random()}.txt`;
|
||||
const file2Shared = `file2Shared-${Utils.random()}.txt`; let file2SharedId;
|
||||
const file2Shared = `file2Shared-${Utils.random()}.txt`;
|
||||
let file2SharedId: string;
|
||||
const file2Recent = `file2Recent-${Utils.random()}.txt`;
|
||||
const file2Favorites = `file2Favorites-${Utils.random()}.txt`; let file2FavoritesId;
|
||||
const file2Favorites = `file2Favorites-${Utils.random()}.txt`;
|
||||
let file2FavoritesId: string;
|
||||
|
||||
let commentFile1Entry;
|
||||
let comment1File2Entry, comment2File2Entry;
|
||||
let commentFile1Entry: any;
|
||||
let comment1File2Entry: any;
|
||||
let comment2File2Entry: any;
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
@@ -73,7 +73,7 @@ describe('Comments', () => {
|
||||
await apis.user.nodes.createFile(file1, parentId);
|
||||
await apis.user.nodes.createFile(file2Personal, parentId);
|
||||
await apis.user.nodes.createFile(file2Recent, parentId);
|
||||
file2SharedId = (await apis.user.nodes.createFile(file2Shared, parentId)).entry.id
|
||||
file2SharedId = (await apis.user.nodes.createFile(file2Shared, parentId)).entry.id;
|
||||
file2FavoritesId = (await apis.user.nodes.createFile(file2Favorites, parentId)).entry.id;
|
||||
|
||||
fileWith1CommentId = (await apis.user.nodes.createFile(fileWith1Comment, parentId)).entry.id;
|
||||
@@ -378,7 +378,10 @@ describe('Comments', () => {
|
||||
expect(await commentsTab.isCommentDisplayed(commentFile1Entry.id)).toBe(true, `Comment with id: ${commentFile1Entry.id} not displayed`);
|
||||
expect(await commentsTab.getCommentText(commentFile1Entry.id)).toBe(commentFile1Entry.content, 'Incorrect comment text');
|
||||
expect(await commentsTab.getCommentUserName(commentFile1Entry.id)).toBe(`${username} ${username}`, 'Incorrect comment user');
|
||||
expect(await commentsTab.getCommentTime(commentFile1Entry.id)).toBe(moment(commentFile1Entry.createdAt).fromNow(), 'Incorrect comment created time');
|
||||
expect(await commentsTab.getCommentTime(commentFile1Entry.id)).toBe(
|
||||
moment(commentFile1Entry.createdAt).fromNow(),
|
||||
'Incorrect comment created time'
|
||||
);
|
||||
expect(await commentsTab.isCommentUserAvatarDisplayed(commentFile1Entry.id)).toBe(true, 'User avatar not displayed');
|
||||
});
|
||||
|
||||
@@ -397,7 +400,10 @@ describe('Comments', () => {
|
||||
expect(await commentsTab.isCommentDisplayed(commentFile1Entry.id)).toBe(true, `Comment with id: ${commentFile1Entry.id} not displayed`);
|
||||
expect(await commentsTab.getCommentText(commentFile1Entry.id)).toBe(commentFile1Entry.content, 'Incorrect comment text');
|
||||
expect(await commentsTab.getCommentUserName(commentFile1Entry.id)).toBe(`${username} ${username}`, 'Incorrect comment user');
|
||||
expect(await commentsTab.getCommentTime(commentFile1Entry.id)).toBe(moment(commentFile1Entry.createdAt).fromNow(), 'Incorrect comment created time');
|
||||
expect(await commentsTab.getCommentTime(commentFile1Entry.id)).toBe(
|
||||
moment(commentFile1Entry.createdAt).fromNow(),
|
||||
'Incorrect comment created time'
|
||||
);
|
||||
expect(await commentsTab.isCommentUserAvatarDisplayed(commentFile1Entry.id)).toBe(true, 'User avatar not displayed');
|
||||
});
|
||||
|
||||
@@ -416,7 +422,10 @@ describe('Comments', () => {
|
||||
expect(await commentsTab.isCommentDisplayed(commentFile1Entry.id)).toBe(true, `Comment with id: ${commentFile1Entry.id} not displayed`);
|
||||
expect(await commentsTab.getCommentText(commentFile1Entry.id)).toBe(commentFile1Entry.content, 'Incorrect comment text');
|
||||
expect(await commentsTab.getCommentUserName(commentFile1Entry.id)).toBe(`${username} ${username}`, 'Incorrect comment user');
|
||||
expect(await commentsTab.getCommentTime(commentFile1Entry.id)).toBe(moment(commentFile1Entry.createdAt).fromNow(), 'Incorrect comment created time');
|
||||
expect(await commentsTab.getCommentTime(commentFile1Entry.id)).toBe(
|
||||
moment(commentFile1Entry.createdAt).fromNow(),
|
||||
'Incorrect comment created time'
|
||||
);
|
||||
expect(await commentsTab.isCommentUserAvatarDisplayed(commentFile1Entry.id)).toBe(true, 'User avatar not displayed');
|
||||
});
|
||||
|
||||
@@ -435,10 +444,11 @@ describe('Comments', () => {
|
||||
expect(await commentsTab.isCommentDisplayed(commentFile1Entry.id)).toBe(true, `Comment with id: ${commentFile1Entry.id} not displayed`);
|
||||
expect(await commentsTab.getCommentText(commentFile1Entry.id)).toBe(commentFile1Entry.content, 'Incorrect comment text');
|
||||
expect(await commentsTab.getCommentUserName(commentFile1Entry.id)).toBe(`${username} ${username}`, 'Incorrect comment user');
|
||||
expect(await commentsTab.getCommentTime(commentFile1Entry.id)).toBe(moment(commentFile1Entry.createdAt).fromNow(), 'Incorrect comment created time');
|
||||
expect(await commentsTab.getCommentTime(commentFile1Entry.id)).toBe(
|
||||
moment(commentFile1Entry.createdAt).fromNow(),
|
||||
'Incorrect comment created time'
|
||||
);
|
||||
expect(await commentsTab.isCommentUserAvatarDisplayed(commentFile1Entry.id)).toBe(true, 'User avatar not displayed');
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
@@ -23,23 +23,15 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {
|
||||
LoginPage,
|
||||
BrowsingPage,
|
||||
RepoClient,
|
||||
InfoDrawer,
|
||||
Utils,
|
||||
FILES,
|
||||
DATE_TIME_FORMAT,
|
||||
DATE_FORMAT
|
||||
} from '@alfresco/aca-testing-shared';
|
||||
import { LoginPage, BrowsingPage, RepoClient, InfoDrawer, Utils, FILES, DATE_TIME_FORMAT, DATE_FORMAT } from '@alfresco/aca-testing-shared';
|
||||
|
||||
import * as moment from 'moment';
|
||||
const moment = require('moment');
|
||||
|
||||
describe('File / Folder properties', () => {
|
||||
const username = `user1-${Utils.random()}`;
|
||||
|
||||
const parent = `parent-${Utils.random()}`; let parentId;
|
||||
const parent = `parent-${Utils.random()}`;
|
||||
let parentId: string;
|
||||
|
||||
const file1 = {
|
||||
name: `file1-${Utils.random()}.txt`,
|
||||
@@ -47,15 +39,15 @@ describe('File / Folder properties', () => {
|
||||
description: 'file description',
|
||||
author: 'file author'
|
||||
};
|
||||
let file1Id;
|
||||
let file1Id: string;
|
||||
|
||||
const image1 = {
|
||||
name: FILES.jpgFile,
|
||||
title: 'image title',
|
||||
description: 'image description',
|
||||
author: 'image author'
|
||||
}
|
||||
let image1Id;
|
||||
};
|
||||
let image1Id: string;
|
||||
|
||||
const folder1 = {
|
||||
name: `folder1-${Utils.random()}`,
|
||||
@@ -63,7 +55,7 @@ describe('File / Folder properties', () => {
|
||||
description: 'folder description',
|
||||
author: 'folder author'
|
||||
};
|
||||
let folder1Id;
|
||||
let folder1Id: string;
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
@@ -152,16 +144,7 @@ describe('File / Folder properties', () => {
|
||||
it('[C307106] Folder properties', async () => {
|
||||
const apiProps = await apis.user.nodes.getNodeById(folder1Id);
|
||||
|
||||
const expectedPropLabels = [
|
||||
'Name',
|
||||
'Title',
|
||||
'Creator',
|
||||
'Created Date',
|
||||
'Modifier',
|
||||
'Modified Date',
|
||||
'Author',
|
||||
'Description'
|
||||
];
|
||||
const expectedPropLabels = ['Name', 'Title', 'Creator', 'Created Date', 'Modifier', 'Modified Date', 'Author', 'Description'];
|
||||
const expectedPropValues = [
|
||||
folder1.name,
|
||||
folder1.title,
|
||||
@@ -231,7 +214,7 @@ describe('File / Folder properties', () => {
|
||||
properties['exif:flash'],
|
||||
properties['exif:focalLength'].toString(),
|
||||
properties['exif:isoSpeedRatings'],
|
||||
(properties['exif:orientation']).toString(),
|
||||
properties['exif:orientation'].toString(),
|
||||
properties['exif:manufacturer'],
|
||||
properties['exif:model'],
|
||||
properties['exif:software']
|
||||
@@ -252,5 +235,4 @@ describe('File / Folder properties', () => {
|
||||
expect(await propertiesTab.isLessInfoButtonEnabled()).toBe(true, 'Less information button not enabled');
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
@@ -23,18 +23,13 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {
|
||||
LoginPage,
|
||||
BrowsingPage,
|
||||
RepoClient,
|
||||
InfoDrawer,
|
||||
Utils
|
||||
} from '@alfresco/aca-testing-shared';
|
||||
import { LoginPage, BrowsingPage, RepoClient, InfoDrawer, Utils } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('General', () => {
|
||||
const username = `user1-${Utils.random()}`;
|
||||
|
||||
const parent = `parent-${Utils.random()}`; let parentId;
|
||||
const parent = `parent-${Utils.random()}`;
|
||||
let parentId: string;
|
||||
|
||||
const file1 = `file1-${Utils.random()}.txt`;
|
||||
const folder1 = `folder1-${Utils.random()}`;
|
||||
@@ -89,5 +84,4 @@ describe('General', () => {
|
||||
|
||||
expect(await infoDrawer.isOpen()).toBe(false, 'Info drawer open');
|
||||
});
|
||||
|
||||
});
|
||||
|
@@ -23,15 +23,7 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {
|
||||
LoginPage,
|
||||
BrowsingPage,
|
||||
SITE_VISIBILITY,
|
||||
SITE_ROLES,
|
||||
RepoClient,
|
||||
InfoDrawer,
|
||||
Utils
|
||||
} from '@alfresco/aca-testing-shared';
|
||||
import { LoginPage, BrowsingPage, SITE_VISIBILITY, SITE_ROLES, RepoClient, InfoDrawer, Utils } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('Library properties', () => {
|
||||
const username = `user1-${Utils.random()}`;
|
||||
@@ -56,7 +48,7 @@ describe('Library properties', () => {
|
||||
name: `site-for-rename-${Utils.random()}`,
|
||||
visibility: SITE_VISIBILITY.PRIVATE,
|
||||
description: 'new description'
|
||||
}
|
||||
};
|
||||
|
||||
const siteDup = `site3-${Utils.random()}`;
|
||||
|
||||
@@ -99,7 +91,7 @@ describe('Library properties', () => {
|
||||
done();
|
||||
});
|
||||
|
||||
afterEach(async done => {
|
||||
afterEach(async (done) => {
|
||||
if (await infoDrawer.isOpen()) {
|
||||
await page.toolbar.viewDetailsButton.click();
|
||||
}
|
||||
@@ -120,7 +112,7 @@ describe('Library properties', () => {
|
||||
|
||||
expect(await aboutTab.getName()).toEqual(site.name);
|
||||
expect(await aboutTab.getLibraryId()).toEqual(site.id);
|
||||
expect((await aboutTab.getVisibility()).toLowerCase()).toEqual((site.visibility).toLowerCase());
|
||||
expect((await aboutTab.getVisibility()).toLowerCase()).toEqual(site.visibility.toLowerCase());
|
||||
expect(await aboutTab.getDescription()).toEqual(site.description);
|
||||
|
||||
expect(await aboutTab.isEditLibraryPropertiesDisplayed()).toBe(true, 'Edit action is not displayed');
|
||||
@@ -231,7 +223,7 @@ describe('Library properties', () => {
|
||||
});
|
||||
|
||||
describe('Non manager', () => {
|
||||
afterAll(async done => {
|
||||
afterAll(async (done) => {
|
||||
await loginPage.loginWith(username);
|
||||
done();
|
||||
});
|
||||
@@ -260,5 +252,4 @@ describe('Library properties', () => {
|
||||
expect(await page.getSnackBarMessage()).toEqual('There was an error updating library properties');
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
Reference in New Issue
Block a user