Skip to content

Commit

Permalink
Merge branch 'develop' into dev-akashrathod28-viewer-exclude
Browse files Browse the repository at this point in the history
  • Loading branch information
akashrathod28 authored Sep 25, 2023
2 parents d51f742 + 97f0138 commit 7ac2957
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 28 deletions.
10 changes: 5 additions & 5 deletions e2e/playwright/navigation/src/tests/sidebar.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,21 +50,21 @@ test.describe('Sidebar', () => {

test('[C269100] sidebar state is preserved on page refresh', async ({ personalFiles }) => {
await personalFiles.navigate();
expect(await personalFiles.sidenav.isSidenavExpanded(), 'Sidebar expanded').toBe(true);
expect(await personalFiles.sidenav.isSidenavExpanded(), 'Sidebar not expanded').toBe(true);
await personalFiles.reload();
expect(await personalFiles.sidenav.isSidenavExpanded(), 'Sidebar expanded').toBe(true);
expect(await personalFiles.sidenav.isSidenavExpanded(), 'Sidebar not expanded').toBe(true);

await personalFiles.sidenav.collapseSideNav();

expect(await personalFiles.sidenav.isSidenavExpanded(), 'Sidebar not expanded').toBe(false);
expect(await personalFiles.sidenav.isSidenavExpanded(), 'Sidebar expanded').toBe(false);
await personalFiles.reload();
expect(await personalFiles.sidenav.isSidenavExpanded(), 'Sidebar not expanded').toBe(false);
expect(await personalFiles.sidenav.isSidenavExpanded(), 'Sidebar expanded').toBe(false);
});

test('[C269096] sidebar toggle', async ({ personalFiles }) => {
await personalFiles.navigate();
await personalFiles.sidenav.collapseSideNav();
expect(await personalFiles.sidenav.isSidenavExpanded(), 'Sidebar not expanded').toBe(false);
expect(await personalFiles.sidenav.isSidenavExpanded(), 'Sidebar expanded').toBe(false);
await personalFiles.sidenav.expandSideNav();
expect(await personalFiles.sidenav.isSidenavExpanded(), 'Sidebar not expanded').toBe(true);
});
Expand Down
13 changes: 6 additions & 7 deletions e2e/protractor/suites/info-drawer/file-folder-properties.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ import {
DATE_FORMAT
} from '@alfresco/aca-testing-shared';
import { BrowserActions } from '@alfresco/adf-testing';

const moment = require('moment');
import { format } from 'date-fns';

describe('File / Folder properties', () => {
const username = `user1-${Utils.random()}`;
Expand Down Expand Up @@ -132,10 +131,10 @@ describe('File / Folder properties', () => {
file1.name,
file1.title,
apiProps.entry.createdByUser.displayName,
moment(apiProps.entry.createdAt).format(DATE_FORMAT),
format(apiProps.entry.createdAt, DATE_FORMAT),
`${apiProps.entry.content.sizeInBytes} Bytes`,
apiProps.entry.modifiedByUser.displayName,
moment(apiProps.entry.modifiedAt).format(DATE_FORMAT),
format(apiProps.entry.modifiedAt, DATE_FORMAT),
apiProps.entry.content.mimeTypeName,
file1.author,
file1.description,
Expand All @@ -160,9 +159,9 @@ describe('File / Folder properties', () => {
folder1.name,
folder1.title,
apiProps.entry.createdByUser.displayName,
moment(apiProps.entry.createdAt).format(DATE_FORMAT),
format(apiProps.entry.createdAt, DATE_FORMAT),
apiProps.entry.modifiedByUser.displayName,
moment(apiProps.entry.modifiedAt).format(DATE_FORMAT),
format(apiProps.entry.modifiedAt, DATE_FORMAT),
folder1.author,
folder1.description,
folder1.contentType
Expand Down Expand Up @@ -220,7 +219,7 @@ describe('File / Folder properties', () => {
const expectedPropValues = [
properties['exif:pixelXDimension']?.toString(),
properties['exif:pixelYDimension']?.toString(),
moment(properties['exif:dateTimeOriginal']).format(DATE_TIME_FORMAT),
format(new Date(properties['exif:dateTimeOriginal']), DATE_TIME_FORMAT),
properties['exif:exposureTime']?.toString(),
properties['exif:fNumber']?.toString(),
properties['exif:flash'],
Expand Down
9 changes: 4 additions & 5 deletions e2e/protractor/suites/search/search-filters.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ import {
SizeOperator
} from '@alfresco/aca-testing-shared';
import { BrowserActions } from '@alfresco/adf-testing';

const moment = require('moment');
import { addDays, format, subDays } from 'date-fns';

describe('Search filters', () => {
const random = Utils.random();
Expand Down Expand Up @@ -162,9 +161,9 @@ describe('Search filters', () => {
});

describe('Filter by Created date', () => {
const yesterday = moment().subtract(1, 'day').format('DD-MMM-YY');
const today = moment().format('DD-MMM-YY');
const future = moment().add(1, 'month').format('DD-MMM-YY');
const yesterday = format(subDays(new Date(), 1), 'dd-MMM-yy');
const today = format(new Date(), 'dd-MMM-yy');
const future = format(addDays(new Date(), 1), 'dd-MMM-yy');

afterEach(async () => {
await Utils.pressEscape();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
*/

import { AdminActions, LoginPage, SearchResultsPage, RepoClient, Utils } from '@alfresco/aca-testing-shared';
const moment = require('moment');
import { format } from 'date-fns';

describe('Search results - files and folders', () => {
const random = Utils.random();
Expand Down Expand Up @@ -92,7 +92,7 @@ describe('Search results - files and folders', () => {
await dataTable.waitForBody();

const fileEntry = await apis.user.nodes.getNodeById(fileId);
const modifiedDate = moment(fileEntry.entry.modifiedAt).format('MMM D, YYYY, h:mm:ss A');
const modifiedDate = format(fileEntry.entry.modifiedAt, 'MMM d, yyyy, h:mm:ss aa');
const modifiedBy = fileEntry.entry.modifiedByUser.displayName;
const size = fileEntry.entry.content.sizeInBytes;

Expand All @@ -114,7 +114,7 @@ describe('Search results - files and folders', () => {
await dataTable.waitForBody();

const folderEntry = await apis.user.nodes.getNodeById(folderId);
const modifiedDate = moment(folderEntry.entry.modifiedAt).format('MMM D, YYYY, h:mm:ss A');
const modifiedDate = format(folderEntry.entry.modifiedAt, 'MMM d, yyyy, h:mm:ss aa');
const modifiedBy = folderEntry.entry.modifiedByUser.displayName;

expect(await dataTable.isItemPresent(folder)).toBe(true, `${folder} is not displayed`);
Expand Down
2 changes: 1 addition & 1 deletion projects/aca-content/assets/app.extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -1244,7 +1244,7 @@
"id": "app.sidebar.expand",
"order": 200,
"title": "APP.INFO_DRAWER.TABS.EXPAND",
"icon": "chevron_left",
"icon": "aspect_ratio",
"actions": {
"click": "EXPAND_INFO_DRAWER"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
data-automation-id="close-library"
title="{{ 'APP.INFO_DRAWER.CLOSE' | translate }}"
(click)="goBack()">
<mat-icon>close</mat-icon>
<mat-icon>fullscreen_exit</mat-icon>
</button>
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import { OnDestroy, OnInit, OnChanges, ViewChild, SimpleChanges, Directive, inje
import { Store } from '@ngrx/store';
import { NodeEntry, Node, NodePaging } from '@alfresco/js-api';
import { Observable, Subject, Subscription } from 'rxjs';
import { takeUntil, map } from 'rxjs/operators';
import { takeUntil } from 'rxjs/operators';
import { DocumentBasePageService } from './document-base-page.service';
import {
AppStore,
Expand Down Expand Up @@ -90,7 +90,7 @@ export abstract class PageComponent implements OnInit, OnDestroy, OnChanges {
});

this.sharedPreviewUrl$ = this.store.select(getSharedUrl);
this.infoDrawerOpened$ = this.store.select(isInfoDrawerOpened).pipe(map((infoDrawerState) => !this.isOutletPreviewUrl() && infoDrawerState));
this.infoDrawerOpened$ = this.store.select(isInfoDrawerOpened);

this.store
.select(getAppSelection)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -355,13 +355,13 @@ describe('Info Drawer state', () => {
});
});

it('should not open info drawer if viewer outlet is active', (done) => {
it('should open info drawer even if viewer outlet is active', (done) => {
window.history.pushState({}, null, `${locationHref}#test(viewer:view)`);
fixture.detectChanges();

fixture.whenStable().then(() => {
component.infoDrawerOpened$.subscribe((state) => {
expect(state).toBe(false);
expect(state).toBe(true);
done();
});
});
Expand Down
4 changes: 2 additions & 2 deletions projects/aca-testing-shared/src/configs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ export const BROWSER_WAIT_TIMEOUT = 10000;
export const USE_HASH_STRATEGY = true;

// Dates
export const DATE_FORMAT = 'MMM D, YYYY';
export const DATE_TIME_FORMAT = 'MMM D, YYYY, H:mm';
export const DATE_FORMAT = 'MMM d, yyyy';
export const DATE_TIME_FORMAT = 'MMM d, yyyy, H:mm';

// Application Routes
export const APP_ROUTES = {
Expand Down

0 comments on commit 7ac2957

Please sign in to comment.