[ADF-3550] Migration - Application List Component (#3902)

* [ADF-3538] start creating new folder for cloud components

* [ADF-3538] added new package to the script and the builds

* [ADF-3538] added some more changes to scripts

* [ADF-3538] - starting the new package

* fix package

* Add a cloud component as example

* Skip the scss style

* remove useless codes

* Add i18n example

* remove useless code

* Simplify the hello component
Fix the wrong path

* add the app-list-cloud-component
add the app-details-cloud-component

* Expose and use the new component

* Consume the new package and component from the demoshell

* Fix unit test app list cloud

* Fix process service cloud path

* Remove useless file

* * Added documentation to the appListcloud component

* Fix failing unit tests
This commit is contained in:
Maurizio Vitale
2018-10-18 17:11:32 +01:00
committed by Eugenio Romano
parent 987c01f1f4
commit 4c9629c2d6
33 changed files with 2357 additions and 965 deletions

View File

@@ -16,7 +16,7 @@
*/
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
import { TestBed, fakeAsync } from '@angular/core/testing';
import { TestBed, fakeAsync, async } from '@angular/core/testing';
import { MatDialogRef, MAT_DIALOG_DATA, MatDialog } from '@angular/material';
import { of } from 'rxjs';
import {
@@ -96,7 +96,7 @@ describe('ShareDialogComponent', () => {
expect(fixture.nativeElement.querySelector('.mat-slide-toggle').classList).toContain('mat-checked');
});
it(`should not toggle share action when file has 'sharedId' property`, () => {
it(`should not toggle share action when file has 'sharedId' property`, async(() => {
spyOn(sharedLinksApiService, 'createSharedLinks');
node.entry.properties['qshare:sharedId'] = 'sharedId';
@@ -108,12 +108,17 @@ describe('ShareDialogComponent', () => {
fixture.detectChanges();
expect(sharedLinksApiService.createSharedLinks).not.toHaveBeenCalled();
expect(fixture.nativeElement.querySelector('input[formcontrolname="sharedUrl"]').value).toBe('some-url/sharedId');
expect(fixture.nativeElement.querySelector('.mat-slide-toggle').classList).toContain('mat-checked');
});
fixture.whenStable().then(() => {
fixture.detectChanges();
it(`should copy shared link and notify on button event`, (done) => {
expect(sharedLinksApiService.createSharedLinks).not.toHaveBeenCalled();
expect(fixture.nativeElement.querySelector('input[formcontrolname="sharedUrl"]').value).toBe('some-url/sharedId');
expect(fixture.nativeElement.querySelector('.mat-slide-toggle').classList).toContain('mat-checked');
});
}));
it(`should copy shared link and notify on button event`, async(() => {
node.entry.properties['qshare:sharedId'] = 'sharedId';
spyOn(document, 'execCommand').and.callThrough();
@@ -134,9 +139,8 @@ describe('ShareDialogComponent', () => {
expect(document.execCommand).toHaveBeenCalledWith('copy');
expect(notificationServiceMock.openSnackMessage).toHaveBeenCalledWith('SHARE.CLIPBOARD-MESSAGE');
done();
});
});
}));
it('should open a confirmation dialog when unshare button is triggered', () => {
spyOn(matDialog, 'open').and.returnValue({ beforeClose: () => of(false) });