mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[PRODSEC-6575] Shared link not accessible now after the expiry date which was earlier accessible even after that expiration date (#8540)
* Shared link expiry date code implementation * test case updated * removed unsed code * design changes as per the new design of Share dialog * test cases modification as per new design changes * placeholder modified for expiration date * look and feel changes for share dialog as per Shane comments * boolean name changed as per naming convention * review comments addressed * review comments addressed * type specified for node object * linting corrections * resolved nested ternary date operation into an independent statement * review comments addressed * used date-fns instead of moment.js in code as well as in test cases * review comments for date-fns addressed * removed extra line * removed extra empty lines in template * import changes and indentation correction * error in console resolved which was occuring after selecting date and time * used mat-datepicker instead of mat-datetimepicker * package-lock.json file updated for date-fns implementation * made type 'date' as default and removed the settings coming from the ACA * unit test case modifications as per calender changes * e2e modifications as per new calendar component
This commit is contained in:
@@ -132,23 +132,6 @@ describe('Share file', () => {
|
||||
await BrowserActions.closeMenuAndDialogs();
|
||||
});
|
||||
|
||||
it('[C286548] Should be possible to set expiry date for link', async () => {
|
||||
await contentServicesPage.clickShareButton();
|
||||
await shareDialog.checkDialogIsDisplayed();
|
||||
await shareDialog.clickExpireToggle();
|
||||
await shareDialog.setDefaultDay();
|
||||
await shareDialog.setDefaultHour();
|
||||
await shareDialog.setDefaultMinutes();
|
||||
await shareDialog.dateTimePickerDialogIsClosed();
|
||||
const value = await shareDialog.getExpirationDate();
|
||||
await shareDialog.clickCloseButton();
|
||||
await shareDialog.dialogIsClosed();
|
||||
await contentServicesPage.clickShareButton();
|
||||
await shareDialog.checkDialogIsDisplayed();
|
||||
await shareDialog.expirationDateInputHasValue(value);
|
||||
await BrowserActions.closeMenuAndDialogs();
|
||||
});
|
||||
|
||||
it('[C310329] Should be possible to set expiry date only for link', async () => {
|
||||
await LocalStorageUtil.setConfigField('sharedLinkDateTimePickerType', JSON.stringify('date'));
|
||||
await contentServicesPage.clickShareButton();
|
||||
|
@@ -17,8 +17,7 @@
|
||||
|
||||
import { $$, $ } from 'protractor';
|
||||
import { BrowserVisibility, TogglePage, BrowserActions, DateTimePickerPage } from '@alfresco/adf-testing';
|
||||
import * as moment from 'moment';
|
||||
|
||||
import { format, add } from 'date-fns';
|
||||
export class ShareDialogPage {
|
||||
|
||||
togglePage = new TogglePage();
|
||||
@@ -85,7 +84,7 @@ export class ShareDialogPage {
|
||||
}
|
||||
|
||||
async calendarTodayDayIsDisabled(): Promise<void> {
|
||||
const tomorrow = moment().add(1, 'days').format('D');
|
||||
const tomorrow = format(add(new Date(), {days: 1}), 'd');
|
||||
|
||||
if (tomorrow !== '1') {
|
||||
await this.dateTimePickerPage.checkCalendarTodayDayIsDisabled();
|
||||
@@ -93,7 +92,7 @@ export class ShareDialogPage {
|
||||
}
|
||||
|
||||
async setDefaultDay(): Promise<void> {
|
||||
const tomorrow = moment().add(1, 'days').format('D');
|
||||
const tomorrow = format(add(new Date(), {days: 1}), 'd');
|
||||
await this.dateTimePickerPage.setDate(tomorrow);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user