mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
👽 Angular 14 rebase 👽 (#7769)
* fix after rebase * new release strategy for ng next Signed-off-by: eromano <eugenioromano16@gmail.com> * peer dep Signed-off-by: eromano <eugenioromano16@gmail.com> * Angular 14 fix unit test and storybook Signed-off-by: eromano <eugenioromano16@gmail.com> fix after rebase Signed-off-by: eromano <eugenioromano16@gmail.com> update pkg.json Signed-off-by: eromano <eugenioromano16@gmail.com> missing dep Signed-off-by: eromano <eugenioromano16@gmail.com> Fix mistake and missing code Dream....build only affected libs Add utility run commands * Use nx command to run affected tests * Fix nx test core fix content tests Run unit with watch false core test fixes reduce test warnings Fix process cloud unit Fix adf unit test Fix lint process cloud Disable lint next line Use right core path Fix insights unit fix linting insights Fix process-services unit fix the extensions test report fix test warnings Fix content unit Fix bunch of content unit * Produce an adf alpha of 14 * hopefully fixing the content * Push back the npm publish * Remove flaky unit * Fix linting * Make the branch as root * Get rid of angualar13 * Remove the travis depth * Fixing version for npm * Enabling cache for unit and build * Fix scss for core and paths Copy i18 and asset by using ng-packager Export the theming alias and fix path Use ng-package to copy assets process-services-cloud Use ng-package to copy assets process-services Use ng-package to copy assets content-services Use ng-package to copy assets insights * feat: fix api secondary entry point * fix storybook rebase * Move dist under dist/libs from lib/dist * Fix the webstyle * Use only necessary nrwl deps and improve lint * Fix unit for libs * Convert lint.sh to targets - improve performance * Use latest of angular * Align alfresco-js-api Signed-off-by: eromano <eugenioromano16@gmail.com> Co-authored-by: eromano <eugenioromano16@gmail.com> Co-authored-by: Mikolaj Serwicki <mikolaj.serwicki@hyland.com> Co-authored-by: Tomasz <tomasz.gnyp@hyland.com>
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
|
||||
import { createApiService,
|
||||
BrowserActions,
|
||||
ErrorPage,
|
||||
LocalStorageUtil,
|
||||
UserInfoPage,
|
||||
UserModel,
|
||||
@@ -33,10 +34,18 @@ describe('Login component', () => {
|
||||
const userInfoPage = new UserInfoPage();
|
||||
const contentServicesPage = new ContentServicesPage();
|
||||
const loginPage = new LoginShellPage();
|
||||
const errorPage = new ErrorPage();
|
||||
|
||||
const userA = new UserModel();
|
||||
const userB = new UserModel();
|
||||
|
||||
const errorMessages = {
|
||||
username: 'Your username needs to be at least 2 characters.',
|
||||
invalid_credentials: 'You\'ve entered an unknown username or password',
|
||||
password: 'Enter your password to sign in',
|
||||
required: 'Required'
|
||||
};
|
||||
|
||||
const apiService = createApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
|
||||
@@ -66,6 +75,59 @@ describe('Login component', () => {
|
||||
await expect(await userInfoPage.getContentHeaderTitle()).toEqual(`${userB.firstName} ${userB.lastName}`);
|
||||
});
|
||||
|
||||
it('[C299206] Should redirect the user without the right access role on a forbidden page', async () => {
|
||||
await loginPage.login(userA.username, userA.password);
|
||||
await navigationBarPage.navigateToProcessServicesCloudPage();
|
||||
await expect(await errorPage.getErrorCode()).toBe('403');
|
||||
await expect(await errorPage.getErrorTitle()).toBe('You don\'t have permission to access this server.');
|
||||
await expect(await errorPage.getErrorDescription()).toBe('You\'re not allowed access to this resource on the server.');
|
||||
});
|
||||
|
||||
it('[C260036] Should require username', async () => {
|
||||
await loginPage.goToLoginPage();
|
||||
await loginPage.checkUsernameInactive();
|
||||
await expect(await loginPage.getSignInButtonIsEnabled()).toBe(false);
|
||||
await loginPage.enterUsername('A');
|
||||
await expect(await loginPage.getUsernameTooltip()).toEqual(errorMessages.username);
|
||||
await loginPage.clearUsername();
|
||||
await expect(await loginPage.getUsernameTooltip()).toEqual(errorMessages.required);
|
||||
await loginPage.checkUsernameHighlighted();
|
||||
await expect(await loginPage.getSignInButtonIsEnabled()).toBe(false);
|
||||
});
|
||||
|
||||
it('[C260044] Username should be at least 2 characters long', async () => {
|
||||
await loginPage.goToLoginPage();
|
||||
await expect(await loginPage.getSignInButtonIsEnabled()).toBe(false);
|
||||
await loginPage.enterUsername('A');
|
||||
await expect(await loginPage.getUsernameTooltip()).toEqual(errorMessages.username);
|
||||
await loginPage.enterUsername('AB');
|
||||
await loginPage.checkUsernameTooltipIsNotVisible();
|
||||
await expect(await loginPage.getSignInButtonIsEnabled()).toBe(false);
|
||||
await loginPage.clearUsername();
|
||||
});
|
||||
|
||||
it('[C260045] Should enable login button after entering a valid username and a password', async () => {
|
||||
await loginPage.goToLoginPage();
|
||||
await loginPage.enterUsername(browser.params.testConfig.users.admin.username);
|
||||
await expect(await loginPage.getSignInButtonIsEnabled()).toBe(false);
|
||||
await loginPage.enterPassword('a');
|
||||
await expect(await loginPage.getSignInButtonIsEnabled()).toBe(true);
|
||||
await loginPage.clearUsername();
|
||||
await loginPage.clearPassword();
|
||||
});
|
||||
|
||||
it('[C260047] Password should be crypted', async () => {
|
||||
await loginPage.goToLoginPage();
|
||||
await expect(await loginPage.getSignInButtonIsEnabled()).toBe(false);
|
||||
await loginPage.enterPassword('test');
|
||||
await loginPage.showPassword();
|
||||
const tooltip = await loginPage.getShownPassword();
|
||||
await expect(tooltip).toEqual('test');
|
||||
await loginPage.hidePassword();
|
||||
await loginPage.checkPasswordIsHidden();
|
||||
await loginPage.clearPassword();
|
||||
});
|
||||
|
||||
it('[C260048] Should be possible to enable/disable login footer', async () => {
|
||||
await loginPage.goToLoginPage();
|
||||
await loginPage.enableFooter();
|
||||
|
@@ -1,5 +1,6 @@
|
||||
{
|
||||
"C269081": "https://alfresco.atlassian.net/browse/ADF-5385",
|
||||
"C272819": "https://alfresco.atlassian.net/browse/ADF-5385",
|
||||
"C362241": "https://alfresco.atlassian.net/browse/ADF-5385"
|
||||
"C362241": "https://alfresco.atlassian.net/browse/ADF-5385",
|
||||
"C260040": "https://alfresco.atlassian.net/browse/AAE-8041"
|
||||
}
|
||||
|
@@ -22,7 +22,7 @@
|
||||
* @class util.Resources
|
||||
*/
|
||||
var path = require('path');
|
||||
const ACTIVITI_CLOUD_APPS = require('../../lib/dist/testing');
|
||||
const ACTIVITI_CLOUD_APPS = require('../../dist/libs/testing');
|
||||
|
||||
const RESOURCES = {
|
||||
...ACTIVITI_CLOUD_APPS,
|
||||
|
Reference in New Issue
Block a user