diff --git a/e2e/pages/adf/dialog/shareDialog.ts b/e2e/pages/adf/dialog/shareDialog.ts index 9f3f9c4da0..505a5e0ff8 100644 --- a/e2e/pages/adf/dialog/shareDialog.ts +++ b/e2e/pages/adf/dialog/shareDialog.ts @@ -17,6 +17,7 @@ import { element, by } from 'protractor'; import Util = require('../../../util/util'); +import moment = require('moment'); import { FormControllersPage } from '../material/formControllersPage'; export class ShareDialog { @@ -110,17 +111,17 @@ export class ShareDialog { this.timeDatePickerButton.click(); } - async calendarTodayDayIsDisabled() { - const today = await this.dayPicker.element(by.css('.mat-datetimepicker-calendar-body-today')).getText(); + calendarTodayDayIsDisabled() { + const today = this.dayPicker.element(by.css('.mat-datetimepicker-calendar-body-today')).getText(); Util.waitUntilElementIsPresent(element(by.cssContainingText('.mat-datetimepicker-calendar-body-disabled', today))); } - async setDefaultDay() { + setDefaultDay() { const selector = '.mat-datetimepicker-calendar-body-active .mat-datetimepicker-calendar-body-cell-content'; Util.waitUntilElementIsVisible(this.dayPicker); - const today = await this.dayPicker.element(by.css('.mat-datetimepicker-calendar-body-today')).getText(); - const tomorrow = (parseInt(today, 10) + 1).toString(); - this.dayPicker.element(by.cssContainingText(selector, tomorrow )).click(); + const tomorrow = moment().add(1, 'day').date(); + let tomorrow = new Date(new Date().getTime() + 24 * 60 * 60 * 1000).getDate().toString(); + this.dayPicker.element(by.cssContainingText(selector, tomorrow)).click(); } setDefaultHour() { diff --git a/lib/content-services/content-node-share/content-node-share.dialog.spec.ts b/lib/content-services/content-node-share/content-node-share.dialog.spec.ts index ed45955e4e..2f55c91111 100644 --- a/lib/content-services/content-node-share/content-node-share.dialog.spec.ts +++ b/lib/content-services/content-node-share/content-node-share.dialog.spec.ts @@ -118,7 +118,7 @@ describe('ShareDialogComponent', () => { }); })); - it(`should copy shared link and notify on button event`, async(() => { + it(`should copy shared link and notify on button event`, (done) => { node.entry.properties['qshare:sharedId'] = 'sharedId'; spyOn(document, 'execCommand').and.callThrough(); @@ -139,8 +139,9 @@ 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) });