Skip to content

Commit

Permalink
Fix e2e/acceptance tests for new date picker
Browse files Browse the repository at this point in the history
  • Loading branch information
dschmidt committed Dec 20, 2022
1 parent dc5e08a commit 4e9d19c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ module.exports = {
moveCalendarYearScript: function (selector, dateRange, done) {
document
.querySelector(selector)
.__vue__.$refs.calendar.move(new Date(Date.parse(dateRange)))
?.__vueParentComponent?.refs?.calendar.move(new Date(Date.parse(dateRange)))
.then(function () {
done(true)
})
Expand All @@ -177,7 +177,10 @@ module.exports = {
}
const dateToSet = new Date(Date.parse(value))
if (shareType === 'link') {
await client.executeAsync(this.moveCalendarYearScript, ['.link-expiry-picker', value])
await client.executeAsync(this.moveCalendarYearScript, [
'.link-expiry-picker:not(.vc-container)',
value
])
} else if (editCollaborator) {
await client.executeAsync(this.moveCalendarYearScript, [
'.collaborator-edit-dropdown-options-list .files-recipient-expiration-datepicker',
Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/support/objects/app-files/link/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export type publicLinkAndItsEditButtonVisibilityArgs = {
space?: boolean
}
const publicLinkSetRoleButton = `#files-role-%s`
const linkExpiryDatepicker = '.link-expiry-picker'
const linkExpiryDatepicker = '.link-expiry-picker:not(.vc-container)'
const publicLinkEditRoleButton =
`//h4[contains(@class, "oc-files-file-link-name") and text()="%s"]//ancestor::li//div[contains(@class, "link-details")]/` +
`div/button[contains(@class, "edit-public-link-role-dropdown-toggle")]`
Expand Down Expand Up @@ -178,7 +178,7 @@ export const addExpiration = async (args: addExpirationArgs): Promise<void> => {

await page.locator(linkExpiryDatepicker).evaluate(
(datePicker: any, { newExpiryDate }): any => {
datePicker.__vue__.updateValue(newExpiryDate)
datePicker?.__vueParentComponent?.refs?.calendar.move(newExpiryDate)
},
{ newExpiryDate }
)
Expand Down

0 comments on commit 4e9d19c

Please sign in to comment.