mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-26 17:24:56 +00:00
* [AAE-10252] Storybook Update existing Stories to adhere to conventions * Added expaned controls globally * About Module, Comments Module * Icon Module, Language Menu Module * Social Module * Naming of single stories * process-services-cloud Modules * Added descriptions and categories for actions * Fixed and cleaned error-content stories * Updated playwright tests to navigate properly * Template Module * Toolbar Module * fixed Like component controls * content projection showcase
69 lines
2.9 KiB
TypeScript
69 lines
2.9 KiB
TypeScript
/*
|
|
* Copyright © 2005 - 2021 Alfresco Software, Ltd. All rights reserved.
|
|
*
|
|
* License rights for this program may be obtained from Alfresco Software, Ltd.
|
|
* pursuant to a written agreement and any use of this program without such an
|
|
* agreement is prohibited.
|
|
*/
|
|
|
|
import { test, expect } from '../fixtures/page-initialization';
|
|
|
|
test.describe.configure({ mode: 'parallel' });
|
|
|
|
test.describe('People component stories tests', () => {
|
|
test('Valid Preselected Users', async ({ processServicesCloud, peopleComponent }) => {
|
|
const expectedUsersName = `
|
|
Yorkshire Pudding cancel
|
|
Shepherds Pie cancel
|
|
Kielbasa Sausage cancel
|
|
`;
|
|
|
|
await processServicesCloud.navigateTo({moduleNames:['people-cloud'], componentName: 'people-cloud', story: 'valid-preselected-users' });
|
|
|
|
await expect(peopleComponent.usersNaming).toContainText(expectedUsersName);
|
|
});
|
|
|
|
test('Mandatory Preselected Users', async ({ processServicesCloud, peopleComponent }) => {
|
|
const expectedUsersName = `
|
|
Kielbasa Sausage
|
|
Shepherds Pie cancel
|
|
`;
|
|
|
|
await processServicesCloud.navigateTo({moduleNames:['people-cloud'], componentName: 'people-cloud', story: 'mandatory-preselected-users' });
|
|
await peopleComponent.getUserLocator('Kielbasa Sausage').hover();
|
|
|
|
await expect.soft(peopleComponent.usersNaming).toContainText(expectedUsersName);
|
|
await expect(peopleComponent.tooltip.content).toContainText('Mandatory');
|
|
});
|
|
|
|
test('Invalid Preselected Users', async ({ processServicesCloud, peopleComponent }) => {
|
|
const expectedWarningMessage = 'No user found with the username Invalid User';
|
|
const expectedWarningIcon = 'error_outline';
|
|
|
|
await processServicesCloud.navigateTo({moduleNames:['people-cloud'], componentName: 'people-cloud', story: 'invalid-preselected-users' });
|
|
|
|
await expect(peopleComponent.error.content).toContainText(expectedWarningIcon + expectedWarningMessage);
|
|
});
|
|
|
|
test('Excluded Users', async ({ processServicesCloud, peopleComponent }) => {
|
|
const expectedExcludedUsers = `
|
|
kielbasa
|
|
yorkshire
|
|
`;
|
|
|
|
await processServicesCloud.navigateTo({moduleNames:['people-cloud'], componentName: 'people-cloud', story: 'excluded-users' });
|
|
await peopleComponent.usersInput.type('user');
|
|
|
|
await expect(peopleComponent.listbox.allOptions).not.toContainText(expectedExcludedUsers);
|
|
});
|
|
|
|
test('No Users', async ({ processServicesCloud, peopleComponent }) => {
|
|
const expectedInformation = 'No user found with the username user';
|
|
|
|
await processServicesCloud.navigateTo({moduleNames:['people-cloud'], componentName: 'people-cloud', story: 'no-users' });
|
|
await peopleComponent.usersInput.type('user');
|
|
|
|
await expect(peopleComponent.listbox.oneOption).toContainText(expectedInformation);
|
|
});
|
|
});
|