Robert Duda 9ba86e1ff1
[AAE-10252] Storybook Update existing Stories to adhere to conventions (#7780)
* [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
2022-09-12 09:03:24 +02:00

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);
});
});