[ADF-4216] Recently uploaded files are missing 'ago' in the Created column (#4578)

* replaced the assertion for 'ago' to 'ago | few'

* replaced the assertion for 'ago' to 'ago | few'
This commit is contained in:
gmandakini 2019-04-10 01:11:35 +01:00 committed by Eugenio Romano
parent 70cf1da78e
commit 4bfae518fb
3 changed files with 12 additions and 12 deletions

View File

@ -204,7 +204,7 @@ describe('Document List Component', () => {
timeAgoUploadedNode = await uploadActions.uploadFile(this.alfrescoJsApi, timeAgoFileModel.location, timeAgoFileModel.name, '-my-'); timeAgoUploadedNode = await uploadActions.uploadFile(this.alfrescoJsApi, timeAgoFileModel.location, timeAgoFileModel.name, '-my-');
contentServicesPage.goToDocumentList(); contentServicesPage.goToDocumentList();
const dateValue = contentServicesPage.getColumnValueForRow(timeAgoFileModel.name, 'Created'); const dateValue = contentServicesPage.getColumnValueForRow(timeAgoFileModel.name, 'Created');
expect(dateValue).toContain('ago'); expect(dateValue).toMatch(/(ago|few)/);
done(); done();
}); });
@ -608,25 +608,25 @@ describe('Document List Component', () => {
expect(contentServicesPage.getAttributeValueForElement(folderName, cardProperties.DISPLAY_NAME)).toBe(folderName); expect(contentServicesPage.getAttributeValueForElement(folderName, cardProperties.DISPLAY_NAME)).toBe(folderName);
expect(contentServicesPage.getAttributeValueForElement(folderName, cardProperties.CREATED_BY)).toBe(`${funnyUser.entry.firstName} ${funnyUser.entry.lastName}`); expect(contentServicesPage.getAttributeValueForElement(folderName, cardProperties.CREATED_BY)).toBe(`${funnyUser.entry.firstName} ${funnyUser.entry.lastName}`);
expect(contentServicesPage.getAttributeValueForElement(folderName, cardProperties.CREATED)).toContain('ago'); expect(contentServicesPage.getAttributeValueForElement(folderName, cardProperties.CREATED)).toMatch(/(ago|few)/);
expect(contentServicesPage.getAttributeValueForElement(pdfFile.name, cardProperties.DISPLAY_NAME)).toBe(pdfFile.name); expect(contentServicesPage.getAttributeValueForElement(pdfFile.name, cardProperties.DISPLAY_NAME)).toBe(pdfFile.name);
expect(contentServicesPage.getAttributeValueForElement(pdfFile.name, cardProperties.SIZE)).toBe(`702.76 KB`); expect(contentServicesPage.getAttributeValueForElement(pdfFile.name, cardProperties.SIZE)).toBe(`702.76 KB`);
expect(contentServicesPage.getAttributeValueForElement(pdfFile.name, cardProperties.CREATED_BY)).toBe(`${funnyUser.entry.firstName} ${funnyUser.entry.lastName}`); expect(contentServicesPage.getAttributeValueForElement(pdfFile.name, cardProperties.CREATED_BY)).toBe(`${funnyUser.entry.firstName} ${funnyUser.entry.lastName}`);
expect(contentServicesPage.getAttributeValueForElement(pdfFile.name, cardProperties.CREATED)).toContain('ago'); expect(contentServicesPage.getAttributeValueForElement(pdfFile.name, cardProperties.CREATED)).toMatch(/(ago|few)/);
expect(contentServicesPage.getAttributeValueForElement(docxFile.name, cardProperties.DISPLAY_NAME)).toBe(docxFile.name); expect(contentServicesPage.getAttributeValueForElement(docxFile.name, cardProperties.DISPLAY_NAME)).toBe(docxFile.name);
expect(contentServicesPage.getAttributeValueForElement(docxFile.name, cardProperties.SIZE)).toBe(`81.05 KB`); expect(contentServicesPage.getAttributeValueForElement(docxFile.name, cardProperties.SIZE)).toBe(`81.05 KB`);
expect(contentServicesPage.getAttributeValueForElement(docxFile.name, cardProperties.CREATED_BY)).toBe(`${funnyUser.entry.firstName} ${funnyUser.entry.lastName}`); expect(contentServicesPage.getAttributeValueForElement(docxFile.name, cardProperties.CREATED_BY)).toBe(`${funnyUser.entry.firstName} ${funnyUser.entry.lastName}`);
expect(contentServicesPage.getAttributeValueForElement(docxFile.name, cardProperties.CREATED)).toContain('ago'); expect(contentServicesPage.getAttributeValueForElement(docxFile.name, cardProperties.CREATED)).toMatch(/(ago|few)/);
expect(contentServicesPage.getAttributeValueForElement(testFile.name, cardProperties.DISPLAY_NAME)).toBe(testFile.name); expect(contentServicesPage.getAttributeValueForElement(testFile.name, cardProperties.DISPLAY_NAME)).toBe(testFile.name);
expect(contentServicesPage.getAttributeValueForElement(testFile.name, cardProperties.SIZE)).toBe(`14 Bytes`); expect(contentServicesPage.getAttributeValueForElement(testFile.name, cardProperties.SIZE)).toBe(`14 Bytes`);
expect(contentServicesPage.getAttributeValueForElement(testFile.name, cardProperties.CREATED_BY)).toBe(`${funnyUser.entry.firstName} ${funnyUser.entry.lastName}`); expect(contentServicesPage.getAttributeValueForElement(testFile.name, cardProperties.CREATED_BY)).toBe(`${funnyUser.entry.firstName} ${funnyUser.entry.lastName}`);
expect(contentServicesPage.getAttributeValueForElement(testFile.name, cardProperties.CREATED)).toContain('ago'); expect(contentServicesPage.getAttributeValueForElement(testFile.name, cardProperties.CREATED)).toMatch(/(ago|few)/);
}); });
it('[C280129] Should keep Gallery View when accessing a folder', () => { it('[C280129] Should keep Gallery View when accessing a folder', () => {

View File

@ -96,7 +96,7 @@ describe('Comment component for Processes', () => {
expect(commentsPage.getTotalNumberOfComments()).toEqual('Comments (' + addedComment.total + ')'); expect(commentsPage.getTotalNumberOfComments()).toEqual('Comments (' + addedComment.total + ')');
expect(commentsPage.getMessage(0)).toEqual(addedComment.data[0].message); expect(commentsPage.getMessage(0)).toEqual(addedComment.data[0].message);
expect(commentsPage.getUserName(0)).toEqual(addedComment.data[0].createdBy.firstName + ' ' + addedComment.data[0].createdBy.lastName); expect(commentsPage.getUserName(0)).toEqual(addedComment.data[0].createdBy.firstName + ' ' + addedComment.data[0].createdBy.lastName);
expect(commentsPage.getTime(0)).toContain('ago'); expect(commentsPage.getTime(0)).toMatch(/(ago|few)/);
}); });
}); });
@ -146,7 +146,7 @@ describe('Comment component for Processes', () => {
expect(commentsPage.getTotalNumberOfComments()).toEqual('Comments (' + addedTaskComment.total + ')'); expect(commentsPage.getTotalNumberOfComments()).toEqual('Comments (' + addedTaskComment.total + ')');
expect(commentsPage.getMessage(0)).toEqual(addedTaskComment.data[0].message); expect(commentsPage.getMessage(0)).toEqual(addedTaskComment.data[0].message);
expect(commentsPage.getUserName(0)).toEqual(addedTaskComment.data[0].createdBy.firstName + ' ' + addedTaskComment.data[0].createdBy.lastName); expect(commentsPage.getUserName(0)).toEqual(addedTaskComment.data[0].createdBy.firstName + ' ' + addedTaskComment.data[0].createdBy.lastName);
expect(commentsPage.getTime(0)).toContain('ago'); expect(commentsPage.getTime(0)).toMatch(/(ago|few)/);
}); });
}); });
}); });

View File

@ -138,8 +138,8 @@ describe('Comment component for Processes', () => {
await expect(commentsPage.getUserName(0)).toEqual(totalComments.data[0].createdBy.firstName + ' ' + totalComments.data[0].createdBy.lastName); await expect(commentsPage.getUserName(0)).toEqual(totalComments.data[0].createdBy.firstName + ' ' + totalComments.data[0].createdBy.lastName);
await expect(commentsPage.getUserName(1)).toEqual(totalComments.data[1].createdBy.firstName + ' ' + totalComments.data[1].createdBy.lastName); await expect(commentsPage.getUserName(1)).toEqual(totalComments.data[1].createdBy.firstName + ' ' + totalComments.data[1].createdBy.lastName);
await expect(commentsPage.getTime(0)).toContain('ago'); await expect(commentsPage.getTime(0)).toMatch(/(ago|few)/);
await expect(commentsPage.getTime(1)).toContain('ago'); await expect(commentsPage.getTime(1)).toMatch(/(ago|few)/);
await loginPage.loginToProcessServicesUsingUserModel(secondUser); await loginPage.loginToProcessServicesUsingUserModel(secondUser);
@ -169,9 +169,9 @@ describe('Comment component for Processes', () => {
await expect(commentsPage.getUserName(1)).toEqual(totalComments.data[1].createdBy.firstName + ' ' + totalComments.data[1].createdBy.lastName); await expect(commentsPage.getUserName(1)).toEqual(totalComments.data[1].createdBy.firstName + ' ' + totalComments.data[1].createdBy.lastName);
await expect(commentsPage.getUserName(2)).toEqual(totalComments.data[2].createdBy.firstName + ' ' + totalComments.data[2].createdBy.lastName); await expect(commentsPage.getUserName(2)).toEqual(totalComments.data[2].createdBy.firstName + ' ' + totalComments.data[2].createdBy.lastName);
await expect(commentsPage.getTime(0)).toContain('ago'); await expect(commentsPage.getTime(0)).toMatch(/(ago|few)/);
await expect(commentsPage.getTime(1)).toContain('ago'); await expect(commentsPage.getTime(1)).toMatch(/(ago|few)/);
await expect(commentsPage.getTime(2)).toContain('ago'); await expect(commentsPage.getTime(2)).toMatch(/(ago|few)/);
}); });
}); });
}); });