From f6ea9d3e2c4f29d07725e716ceab3bdc742c9cd0 Mon Sep 17 00:00:00 2001 From: George Gevoian Date: Fri, 29 Sep 2023 03:03:17 -0400 Subject: [PATCH 01/16] Optimize calendar performance and fix bugs --- calendar/page.js | 71 ++++++++++++++++++++++++++++++------------------ 1 file changed, 45 insertions(+), 26 deletions(-) diff --git a/calendar/page.js b/calendar/page.js index 40926544..43aef89b 100644 --- a/calendar/page.js +++ b/calendar/page.js @@ -168,7 +168,6 @@ class CalendarHandler { container.classList.add('readonly') } const options = this._getCalendarOptions(); - this.previousIds = new Set(); this.calendar = new tui.Calendar(container, options); // Not sure how to get a reference to this constructor, so doing it in a roundabout way. @@ -223,6 +222,12 @@ class CalendarHandler { container.querySelector('button.toastui-calendar-popup-confirm')?.click(); } }); + + // All events, indexed by id. + this.allEvents = new Map(); + + // Visible events that fall within the current date range, indexed by id. */ + this.visibleEvents = new Map(); } _isMultidayInMonthViewEvent(rec) { @@ -239,6 +244,7 @@ class CalendarHandler { if (!isRecordValid(record) || this._selectedRecordId === record.id) { return; } + if (this._selectedRecordId) { this._colorCalendarEvent(this._selectedRecordId, this._mainColor); } @@ -270,6 +276,8 @@ class CalendarHandler { _colorCalendarEvent(eventId, color) { const event = this.calendar.getEvent(eventId, CALENDAR_NAME); + if (!event) { return; } + const shouldPaintBackground = this._isMultidayInMonthViewEvent(event); this.calendar.updateEvent(eventId, CALENDAR_NAME, {borderColor: color, backgroundColor: shouldPaintBackground?color:this._mainColor}); } @@ -304,31 +312,40 @@ class CalendarHandler { } } - // update calendar events based on the collection of records from the grist table. - async updateCalendarEvents(calendarEvents) { - // we need to keep track the ids of the events that are currently in the calendar to compare it - // with the new set of events when they come. - const currentIds = new Set(); - for (const record of calendarEvents) { - // check if an event already exists in the calendar - update it if so, create new otherwise - const event = this.calendar.getEvent(record.id, CALENDAR_NAME); - const eventData = record; - if (!event) { - this.calendar.createEvents([eventData]); + setEvents(events) { + this.allEvents = events; + } + + /** + * Adds/updates events that fall within the current date range, and removes + * events that do not. + */ + renderVisibleEvents() { + const newVisibleEvents = new Map(); + const dateRangeStart = this.calendar.getDateRangeStart(); + const dateRangeEnd = this.calendar.getDateRangeEnd(); + + // Add or update events that are now visible. + for (const event of this.allEvents) { + if (event.start < dateRangeStart || event.end > dateRangeEnd) { continue; } + + const calendarEvent = this.calendar.getEvent(event.id, CALENDAR_NAME); + if (!calendarEvent) { + this.calendar.createEvents([event]); } else { - this.calendar.updateEvent(record.id, CALENDAR_NAME, eventData); + this.calendar.updateEvent(event.id, CALENDAR_NAME, event); } - currentIds.add(record.id); + newVisibleEvents.set(event.id, event); } - // if some events are not in the new set of events, we need to remove them from the calendar - if (this.previousIds) { - for (const id of this.previousIds) { - if (!currentIds.has(id)) { - this.calendar.deleteEvent(id, CALENDAR_NAME); - } + + // Remove events that are no longer visible. + for (const eventId of this.visibleEvents.keys()) { + if (!newVisibleEvents.has(eventId)) { + this.calendar.deleteEvent(eventId, CALENDAR_NAME); } } - this.previousIds = currentIds; + + this.visibleEvents = newVisibleEvents; } setTheme(gristThemeConfiguration) { @@ -386,6 +403,7 @@ function getGristOptions() { function updateUIAfterNavigation(){ + calendarHandler.renderVisibleEvents(); // update name of the month and year displayed on the top of the widget document.getElementById('calendar-title').innerText = getMonthName(); // refresh colors of selected event (in month view it's different from in other views) @@ -521,11 +539,11 @@ function selectRadioButton(value) { for (const element of document.getElementsByName('calendar-options')) { if (element.value === value) { element.checked = true; - element.parentElement.classList.add('active') + element.parentElement.classList.add('active'); } else{ element.checked = false; - element.parentElement.classList.remove('active') + element.parentElement.classList.remove('active'); } } } @@ -549,7 +567,7 @@ function buildCalendarEventObject(record, colTypes) { let [startType, endType] = colTypes; endType = endType || startType; start = getAdjustedDate(start, startType); - end = end ? getAdjustedDate(end, endType) : start + end = end ? getAdjustedDate(end, endType) : start; // Normalize records with invalid start/end times so that they're visible // in the calendar. @@ -582,8 +600,9 @@ async function updateCalendar(records, mappings) { // if any records were successfully mapped, create or update them in the calendar if (mappedRecords) { const colTypes = await colTypesFetcher.getColTypes(); - const CalendarEventObjects = mappedRecords.filter(isRecordValid).map(r => buildCalendarEventObject(r, colTypes)); - await calendarHandler.updateCalendarEvents(CalendarEventObjects); + const events = mappedRecords.filter(isRecordValid).map(r => buildCalendarEventObject(r, colTypes)); + calendarHandler.setEvents(events); + calendarHandler.renderVisibleEvents(); } dataVersion = Date.now(); } From ff78779bf573c034f43c602936364105142795be Mon Sep 17 00:00:00 2001 From: George Gevoian Date: Sun, 1 Oct 2023 21:17:32 -0400 Subject: [PATCH 02/16] Fix bugs and debounce rendering --- calendar/index.html | 1 + calendar/page.js | 38 ++++++++++++++++++++++----------- test/calendar.ts | 51 ++++++++++++++++++++++++++++++--------------- 3 files changed, 61 insertions(+), 29 deletions(-) diff --git a/calendar/index.html b/calendar/index.html index 07088fe9..b7effdf5 100644 --- a/calendar/index.html +++ b/calendar/index.html @@ -54,6 +54,7 @@ + diff --git a/calendar/page.js b/calendar/page.js index 43aef89b..2c488fec 100644 --- a/calendar/page.js +++ b/calendar/page.js @@ -163,6 +163,11 @@ class CalendarHandler { } constructor() { + this.renderVisibleEvents = _.debounce(this._renderVisibleEvents, 1000, { + leading: true, + trailing: true + }); + const container = document.getElementById('calendar'); if (isReadOnly) { container.classList.add('readonly') @@ -226,8 +231,8 @@ class CalendarHandler { // All events, indexed by id. this.allEvents = new Map(); - // Visible events that fall within the current date range, indexed by id. */ - this.visibleEvents = new Map(); + // Ids of visible events that fall within the current date range. */ + this.visibleEventIds = new Set(); } _isMultidayInMonthViewEvent(rec) { @@ -248,10 +253,10 @@ class CalendarHandler { if (this._selectedRecordId) { this._colorCalendarEvent(this._selectedRecordId, this._mainColor); } - this._selectedRecordId = record.id; const [startType] = await colTypesFetcher.getColTypes(); const startDate = getAdjustedDate(record.startDate, startType); this.calendar.setDate(startDate); + this._selectedRecordId = record.id; updateUIAfterNavigation(); // If the view has a vertical timeline, scroll to the start of the event. @@ -279,7 +284,10 @@ class CalendarHandler { if (!event) { return; } const shouldPaintBackground = this._isMultidayInMonthViewEvent(event); - this.calendar.updateEvent(eventId, CALENDAR_NAME, {borderColor: color, backgroundColor: shouldPaintBackground?color:this._mainColor}); + this.calendar.updateEvent(eventId, CALENDAR_NAME, { + borderColor: color, + backgroundColor: shouldPaintBackground ? color : this._mainColor, + }); } // change calendar perspective between week, month and day. @@ -320,14 +328,20 @@ class CalendarHandler { * Adds/updates events that fall within the current date range, and removes * events that do not. */ - renderVisibleEvents() { - const newVisibleEvents = new Map(); + _renderVisibleEvents() { + const newVisibleEventIds = new Set(); const dateRangeStart = this.calendar.getDateRangeStart(); - const dateRangeEnd = this.calendar.getDateRangeEnd(); + const dateRangeEnd = this.calendar.getDateRangeEnd().setHours(23, 99, 99, 999); // Add or update events that are now visible. for (const event of this.allEvents) { - if (event.start < dateRangeStart || event.end > dateRangeEnd) { continue; } + const isEventInRange = ( + (event.start >= dateRangeStart && event.start <= dateRangeEnd) || + (event.end >= dateRangeStart && event.end <= dateRangeEnd) || + (event.start >= dateRangeStart && event.start <= dateRangeEnd) || + (event.start < dateRangeStart && event.end > dateRangeEnd) + ); + if (!isEventInRange) { continue; } const calendarEvent = this.calendar.getEvent(event.id, CALENDAR_NAME); if (!calendarEvent) { @@ -335,17 +349,17 @@ class CalendarHandler { } else { this.calendar.updateEvent(event.id, CALENDAR_NAME, event); } - newVisibleEvents.set(event.id, event); + newVisibleEventIds.add(event.id); } // Remove events that are no longer visible. - for (const eventId of this.visibleEvents.keys()) { - if (!newVisibleEvents.has(eventId)) { + for (const eventId of this.visibleEventIds) { + if (!newVisibleEventIds.has(eventId)) { this.calendar.deleteEvent(eventId, CALENDAR_NAME); } } - this.visibleEvents = newVisibleEvents; + this.visibleEventIds = newVisibleEventIds; } setTheme(gristThemeConfiguration) { diff --git a/test/calendar.ts b/test/calendar.ts index 79d8642b..c0aa1dd7 100644 --- a/test/calendar.ts +++ b/test/calendar.ts @@ -1,4 +1,4 @@ -import {assert, driver} from 'mocha-webdriver'; +import {Key, assert, driver} from 'mocha-webdriver'; import {getGrist} from "./getGrist"; //not a pretty way to get events from currently used calendar control. but it's working. @@ -194,29 +194,26 @@ describe('calendar', function () { // Now try to add a record. It should fail. await clickDay(10); - await grist.waitForServer(); - assert.equal(await eventsCount(), 0); + await assertNewEventPopupDisplayed(false); - // We don't have a good way of checking it. So we just check at the end that we have only one event.. + // We don't have a good way of checking it. So we just check at the end that we have only one event. // Now with read access. await grist.setCustomWidgetAccess('read table'); await grist.waitForServer(); await grist.waitForFrame(); - // Now try to add a record. It should fail. + // Try to add a record again. It should still fail. await clickDay(11); - await grist.waitForServer(); - assert.equal(await eventsCount(), 0); + await assertNewEventPopupDisplayed(false); // Now with full access. await grist.setCustomWidgetAccess('full'); await grist.waitForServer(); await grist.waitForFrame(); - await clickDay(12); + await createCalendarEvent(12, 'Test1'); await grist.waitForServer(); - await grist.waitToPass(async () => { assert.equal(await eventsCount(), 1); }); @@ -237,10 +234,10 @@ describe('calendar', function () { ]); // Add 4 events in the calendar. - await clickDay(14); - await clickDay(15); - await clickDay(16); - await clickDay(17); + await createCalendarEvent(14, 'Test2'); + await createCalendarEvent(15, 'Test3'); + await createCalendarEvent(16, 'Test4'); + await createCalendarEvent(17, 'Test5'); // Now test if bi-directional mapping works. await grist.waitToPass(async () => { @@ -252,7 +249,7 @@ describe('calendar', function () { assert.equal(await selectedRow(), 2); - // Calendar should be focues on 3rd event. + // Calendar should be focused on 3rd event. assert.isTrue(await getCalendarEvent(3).then(c => c.selected)); // Click 4th row @@ -292,18 +289,38 @@ describe('calendar', function () { //TODO: test adding new events and moving existing one on the calendar. ToastUI is not best optimized for drag and drop tests in mocha and i cannot yet make it working correctly. /** - * Clicks on a day in a month view. + * Clicks the cell for `day` in the calendar. */ - async function clickDay(which: number) { + async function clickDay(day: number) { await grist.inCustomWidget(async () => { await driver.withActions(ac => - ac.move({origin: driver.findContentWait(`.toastui-calendar-template-monthGridHeader`, String(which), 200)}) + ac.move({origin: driver.findContentWait(`.toastui-calendar-template-monthGridHeader`, String(day), 200)}) .press().pause(100).release() ); }); + } + + /** + * Creates an event in the calendar with title `eventTitle` for the specified `day`. + */ + async function createCalendarEvent(day: number, eventTitle: string) { + await grist.inCustomWidget(async () => { + await driver.withActions(ac => + ac.move({origin: driver.findContentWait(`.toastui-calendar-template-monthGridHeader`, String(day), 200)}) + .press().pause(100).release() + ); + await driver.findWait('.toastui-calendar-popup-container', 1000); + await driver.sendKeys(eventTitle, Key.ENTER); + }); await grist.waitForServer(); } + async function assertNewEventPopupDisplayed(expected: boolean) { + await grist.inCustomWidget(async () => { + assert.equal(await driver.find('.toastui-calendar-popup-container').isPresent(), expected); + }); + } + function eventsCount() { return grist.inCustomWidget(async () => { // We see only summaries (like 1 more) From 7cacd590dc0b2863abec8458009c83f42cbdb2ec Mon Sep 17 00:00:00 2001 From: George Gevoian Date: Sun, 1 Oct 2023 21:44:21 -0400 Subject: [PATCH 03/16] Update tests --- calendar/page.js | 16 ++++++++++++---- test/calendar.ts | 37 ++++++++++++++++++++++--------------- 2 files changed, 34 insertions(+), 19 deletions(-) diff --git a/calendar/page.js b/calendar/page.js index 2c488fec..b1b2ee3a 100644 --- a/calendar/page.js +++ b/calendar/page.js @@ -680,14 +680,23 @@ class ColTypesFetcher { const colTypesFetcher = new ColTypesFetcher(); function testGetCalendarEvent(eventId) { - const calendarObject = calendarHandler.calendar.getEvent(eventId, CALENDAR_NAME); - if (calendarObject) { + const event = calendarHandler.calendar.allEvents.get(eventId); + return testGetEventAsJSON(event); +} + +function testGetVisibleCalendarEvent(eventId) { + const event = calendarHandler.calendar.getEvent(eventId, CALENDAR_NAME); + return testGetEventAsJSON(event); +} + +function testGetEventAsJSON(event) { + if (event) { const eventData = { title: calendarObject?.title, startDate: calendarObject?.start.d.d, endDate: calendarObject?.end.d.d, isAllDay: calendarObject?.isAllday ?? false, - selected: calendarObject?.borderColor === calendarHandler._selectedColor + selected: calendarObject?.borderColor === calendarHandler._selectedColor, }; return JSON.stringify(eventData); } else { @@ -696,6 +705,5 @@ function testGetCalendarEvent(eventId) { } function testGetCalendarViewName(){ - // noinspection JSUnresolvedReference return calendarHandler.calendar.getViewName(); } diff --git a/test/calendar.ts b/test/calendar.ts index c0aa1dd7..4f772e14 100644 --- a/test/calendar.ts +++ b/test/calendar.ts @@ -1,11 +1,6 @@ import {Key, assert, driver} from 'mocha-webdriver'; import {getGrist} from "./getGrist"; -//not a pretty way to get events from currently used calendar control. but it's working. -function buildGetCalendarObjectScript(eventId: number) { - return `return testGetCalendarEvent(${eventId});` -} - describe('calendar', function () { this.timeout('30s'); const grist = getGrist(); @@ -20,14 +15,26 @@ describe('calendar', function () { }); } - //wait until the event is loaded on the calendar + // Not a pretty way to get events from currently used calendar control. but it's working. + function buildGetVisibleCalendarEvent(eventId: number) { + return `return testGetVisibleCalendarEvent(${eventId});` + } + + async function getVisibleCalendarEvent(eventId: number): Promise { + const event = await grist.executeScriptOnCustomWidget(buildGetVisibleCalendarEvent(eventId)); + return JSON.parse(event as any); + } + + function buildGetCalendarEvent(eventId: number) { + return `return testGetCalendarEvent(${eventId});` + } + async function getCalendarEvent(eventId: number): Promise { - let mappedObject: any; - mappedObject = await grist.executeScriptOnCustomWidget(buildGetCalendarObjectScript(eventId)); - return JSON.parse(mappedObject); + const event = await grist.executeScriptOnCustomWidget(buildGetCalendarEvent(eventId)); + return JSON.parse(event as any); } - async function getCalendarSettings(): Promise { + async function getCalendarViewName(): Promise { return await grist.executeScriptOnCustomWidget('return testGetCalendarViewName()'); } @@ -118,17 +125,17 @@ describe('calendar', function () { await grist.inCustomWidget(async () => { await driver.findWait('#calendar-day-label', 200).click(); }); - let viewType = await getCalendarSettings(); + let viewType = await getCalendarViewName(); assert.equal(viewType, 'day'); await grist.inCustomWidget(async () => { await driver.findWait('#calendar-month-label', 200).click(); }); - viewType = await getCalendarSettings(); + viewType = await getCalendarViewName(); assert.equal(viewType, 'month'); await grist.inCustomWidget(async () => { await driver.findWait('#calendar-week-label', 200).click(); }); - viewType = await getCalendarSettings(); + viewType = await getCalendarViewName(); assert.equal(viewType, 'week'); }) @@ -250,12 +257,12 @@ describe('calendar', function () { assert.equal(await selectedRow(), 2); // Calendar should be focused on 3rd event. - assert.isTrue(await getCalendarEvent(3).then(c => c.selected)); + assert.isTrue(await getVisibleCalendarEvent(3).then(c => c.selected)); // Click 4th row await clickRow(3); assert.equal(await selectedRow(), 3); - assert.isTrue(await getCalendarEvent(4).then(c => c.selected)); + assert.isTrue(await getVisibleCalendarEvent(4).then(c => c.selected)); // Now click on the last visible event await grist.inCustomWidget(async () => { From 9c9544a30b1302b431882ef6052e5bdbe953370f Mon Sep 17 00:00:00 2001 From: George Gevoian Date: Sun, 1 Oct 2023 21:47:32 -0400 Subject: [PATCH 04/16] Revert debouncing --- calendar/index.html | 1 - calendar/page.js | 7 +------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/calendar/index.html b/calendar/index.html index b7effdf5..07088fe9 100644 --- a/calendar/index.html +++ b/calendar/index.html @@ -54,7 +54,6 @@ - diff --git a/calendar/page.js b/calendar/page.js index b1b2ee3a..7ad83cef 100644 --- a/calendar/page.js +++ b/calendar/page.js @@ -163,11 +163,6 @@ class CalendarHandler { } constructor() { - this.renderVisibleEvents = _.debounce(this._renderVisibleEvents, 1000, { - leading: true, - trailing: true - }); - const container = document.getElementById('calendar'); if (isReadOnly) { container.classList.add('readonly') @@ -328,7 +323,7 @@ class CalendarHandler { * Adds/updates events that fall within the current date range, and removes * events that do not. */ - _renderVisibleEvents() { + renderVisibleEvents() { const newVisibleEventIds = new Set(); const dateRangeStart = this.calendar.getDateRangeStart(); const dateRangeEnd = this.calendar.getDateRangeEnd().setHours(23, 99, 99, 999); From 6d7d7f5c27c779070240282b4298290aee594b3d Mon Sep 17 00:00:00 2001 From: George Gevoian Date: Sun, 1 Oct 2023 21:50:55 -0400 Subject: [PATCH 05/16] Fix test helper --- calendar/page.js | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/calendar/page.js b/calendar/page.js index 7ad83cef..5a9823f2 100644 --- a/calendar/page.js +++ b/calendar/page.js @@ -224,10 +224,10 @@ class CalendarHandler { }); // All events, indexed by id. - this.allEvents = new Map(); + this._allEvents = new Map(); // Ids of visible events that fall within the current date range. */ - this.visibleEventIds = new Set(); + this._visibleEventIds = new Set(); } _isMultidayInMonthViewEvent(rec) { @@ -315,8 +315,12 @@ class CalendarHandler { } } + getEvents() { + return this._allEvents; + } + setEvents(events) { - this.allEvents = events; + this._allEvents = events; } /** @@ -329,7 +333,7 @@ class CalendarHandler { const dateRangeEnd = this.calendar.getDateRangeEnd().setHours(23, 99, 99, 999); // Add or update events that are now visible. - for (const event of this.allEvents) { + for (const event of this._allEvents) { const isEventInRange = ( (event.start >= dateRangeStart && event.start <= dateRangeEnd) || (event.end >= dateRangeStart && event.end <= dateRangeEnd) || @@ -348,13 +352,13 @@ class CalendarHandler { } // Remove events that are no longer visible. - for (const eventId of this.visibleEventIds) { + for (const eventId of this._visibleEventIds) { if (!newVisibleEventIds.has(eventId)) { this.calendar.deleteEvent(eventId, CALENDAR_NAME); } } - this.visibleEventIds = newVisibleEventIds; + this._visibleEventIds = newVisibleEventIds; } setTheme(gristThemeConfiguration) { @@ -675,7 +679,7 @@ class ColTypesFetcher { const colTypesFetcher = new ColTypesFetcher(); function testGetCalendarEvent(eventId) { - const event = calendarHandler.calendar.allEvents.get(eventId); + const event = calendarHandler.getEvents().get(eventId); return testGetEventAsJSON(event); } From c18426f5a03c1e277b157a5d5fcefd71c2c54345 Mon Sep 17 00:00:00 2001 From: George Gevoian Date: Sun, 1 Oct 2023 22:16:50 -0400 Subject: [PATCH 06/16] Fix broken code --- calendar/page.js | 40 +++++++++++++++++++++------------------- test/calendar.ts | 2 -- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/calendar/page.js b/calendar/page.js index 5a9823f2..bffcb4ba 100644 --- a/calendar/page.js +++ b/calendar/page.js @@ -333,7 +333,7 @@ class CalendarHandler { const dateRangeEnd = this.calendar.getDateRangeEnd().setHours(23, 99, 99, 999); // Add or update events that are now visible. - for (const event of this._allEvents) { + for (const event of this._allEvents.values()) { const isEventInRange = ( (event.start >= dateRangeStart && event.start <= dateRangeEnd) || (event.end >= dateRangeStart && event.end <= dateRangeEnd) || @@ -614,7 +614,7 @@ async function updateCalendar(records, mappings) { if (mappedRecords) { const colTypes = await colTypesFetcher.getColTypes(); const events = mappedRecords.filter(isRecordValid).map(r => buildCalendarEventObject(r, colTypes)); - calendarHandler.setEvents(events); + calendarHandler.setEvents(new Map(events.map(event => ([event.id, event])))); calendarHandler.renderVisibleEvents(); } dataVersion = Date.now(); @@ -680,27 +680,29 @@ const colTypesFetcher = new ColTypesFetcher(); function testGetCalendarEvent(eventId) { const event = calendarHandler.getEvents().get(eventId); - return testGetEventAsJSON(event); + if (!event) { return null; } + + const eventData = { + title: event.title, + startDate: event.start, + endDate: event.end, + isAllDay: event.isAllday, + }; + return JSON.stringify(eventData); } function testGetVisibleCalendarEvent(eventId) { const event = calendarHandler.calendar.getEvent(eventId, CALENDAR_NAME); - return testGetEventAsJSON(event); -} - -function testGetEventAsJSON(event) { - if (event) { - const eventData = { - title: calendarObject?.title, - startDate: calendarObject?.start.d.d, - endDate: calendarObject?.end.d.d, - isAllDay: calendarObject?.isAllday ?? false, - selected: calendarObject?.borderColor === calendarHandler._selectedColor, - }; - return JSON.stringify(eventData); - } else { - return null; - } + if (!event) { return null; } + + const eventData = { + title: event?.title, + startDate: event?.start.d.d, + endDate: event?.end.d.d, + isAllDay: event?.isAllday ?? false, + selected: event?.borderColor === calendarHandler._selectedColor, + }; + return JSON.stringify(eventData); } function testGetCalendarViewName(){ diff --git a/test/calendar.ts b/test/calendar.ts index 4f772e14..627e7f61 100644 --- a/test/calendar.ts +++ b/test/calendar.ts @@ -71,7 +71,6 @@ describe('calendar', function () { startDate: new Date('2023-08-03 13:00').toJSON(), endDate: new Date('2023-08-03 14:00').toJSON(), isAllDay: false, - selected: false, }) }); @@ -109,7 +108,6 @@ describe('calendar', function () { startDate: new Date('2023-08-03 13:00').toJSON(), endDate: new Date('2023-08-03 15:00').toJSON(), isAllDay: false, - selected: false, }) }); From 114d1156b86cab186565fd9bc85d4f627dfa40b8 Mon Sep 17 00:00:00 2001 From: George Gevoian Date: Mon, 9 Oct 2023 22:00:02 -0400 Subject: [PATCH 07/16] Address comments --- calendar/page.js | 5 ++--- test/calendar.ts | 33 +++++++++++++++------------------ test/getGrist.ts | 27 +++++---------------------- 3 files changed, 22 insertions(+), 43 deletions(-) diff --git a/calendar/page.js b/calendar/page.js index bffcb4ba..b9e734af 100644 --- a/calendar/page.js +++ b/calendar/page.js @@ -337,7 +337,6 @@ class CalendarHandler { const isEventInRange = ( (event.start >= dateRangeStart && event.start <= dateRangeEnd) || (event.end >= dateRangeStart && event.end <= dateRangeEnd) || - (event.start >= dateRangeStart && event.start <= dateRangeEnd) || (event.start < dateRangeStart && event.end > dateRangeEnd) ); if (!isEventInRange) { continue; } @@ -688,7 +687,7 @@ function testGetCalendarEvent(eventId) { endDate: event.end, isAllDay: event.isAllday, }; - return JSON.stringify(eventData); + return eventData; } function testGetVisibleCalendarEvent(eventId) { @@ -702,7 +701,7 @@ function testGetVisibleCalendarEvent(eventId) { isAllDay: event?.isAllday ?? false, selected: event?.borderColor === calendarHandler._selectedColor, }; - return JSON.stringify(eventData); + return eventData; } function testGetCalendarViewName(){ diff --git a/test/calendar.ts b/test/calendar.ts index 627e7f61..fd35ede8 100644 --- a/test/calendar.ts +++ b/test/calendar.ts @@ -15,31 +15,28 @@ describe('calendar', function () { }); } - // Not a pretty way to get events from currently used calendar control. but it's working. - function buildGetVisibleCalendarEvent(eventId: number) { - return `return testGetVisibleCalendarEvent(${eventId});` - } - async function getVisibleCalendarEvent(eventId: number): Promise { - const event = await grist.executeScriptOnCustomWidget(buildGetVisibleCalendarEvent(eventId)); - return JSON.parse(event as any); - } - - function buildGetCalendarEvent(eventId: number) { - return `return testGetCalendarEvent(${eventId});` + return grist.inCustomWidget(() => { + return (window as any).testGetVisibleCalendarEvent(eventId); + }); } async function getCalendarEvent(eventId: number): Promise { - const event = await grist.executeScriptOnCustomWidget(buildGetCalendarEvent(eventId)); - return JSON.parse(event as any); + return grist.inCustomWidget(() => { + return (window as any).testGetCalendarEvent(eventId); + }); } async function getCalendarViewName(): Promise { - return await grist.executeScriptOnCustomWidget('return testGetCalendarViewName()'); + return grist.inCustomWidget(() => { + return (window as any).testGetCalendarViewName(); + }); } async function getDateVersion(): Promise { - return await grist.executeScriptOnCustomWidget('return testGetDataVersion()'); + return grist.inCustomWidget(() => { + return (window as any).testGetDataVersion(); + }); } before(async function () { @@ -140,9 +137,9 @@ describe('calendar', function () { it('should navigate to appropriate time periods when button is pressed', async function () { const today = new Date(); const validateDate = async (daysToAdd: number) => { - const newDate = await grist.executeScriptOnCustomWidget( - 'return calendarHandler.calendar.getDate().d.toDate().toDateString()' - ); + const newDate = await grist.inCustomWidget(() => { + return (window as any).calendarHandler.calendar.getDate().d.toDate().toDateString(); + }); const expectedDate = new Date(today); expectedDate.setDate(today.getDate() + daysToAdd); diff --git a/test/getGrist.ts b/test/getGrist.ts index a04538b4..fe38891a 100644 --- a/test/getGrist.ts +++ b/test/getGrist.ts @@ -263,28 +263,6 @@ export class GristUtils extends GristWebDriverUtils { await clickOption(value); } - // Crude, assumes a single iframe. Should elaborate. - public async getCustomWidgetBody(selector: string = 'html'): Promise { - const iframe = this.driver.find('iframe'); - try { - await this.driver.switchTo().frame(iframe); - return await this.driver.find(selector).getText(); - } finally { - await this.driver.switchTo().defaultContent(); - } - } - - public async executeScriptOnCustomWidget(script: string | Function): Promise { - const iframe = this.driver.find('iframe'); - try { - await this.driver.switchTo().frame(iframe); - const jsValue = await this.driver.executeScript(script); - return jsValue as T; - } finally { - await this.driver.switchTo().defaultContent(); - } - } - public async inCustomWidget(op: () => Promise): Promise { const iframe = driver.find('iframe'); try { @@ -294,4 +272,9 @@ export class GristUtils extends GristWebDriverUtils { await driver.switchTo().defaultContent(); } } + + // Crude, assumes a single iframe. Should elaborate. + public async getCustomWidgetBody(selector: string = 'html'): Promise { + return this.inCustomWidget(() => this.driver.find(selector).getText()); + } } From 92e37c646be70c32ecf8eea9aa08d3991d77e2a1 Mon Sep 17 00:00:00 2001 From: George Gevoian Date: Mon, 9 Oct 2023 22:11:13 -0400 Subject: [PATCH 08/16] Add missing code --- test/calendar.ts | 10 +++++----- test/getGrist.ts | 6 ++++++ 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/test/calendar.ts b/test/calendar.ts index fd35ede8..9a1e050a 100644 --- a/test/calendar.ts +++ b/test/calendar.ts @@ -16,25 +16,25 @@ describe('calendar', function () { } async function getVisibleCalendarEvent(eventId: number): Promise { - return grist.inCustomWidget(() => { + return grist.executeScriptInCustomWidget(() => { return (window as any).testGetVisibleCalendarEvent(eventId); }); } async function getCalendarEvent(eventId: number): Promise { - return grist.inCustomWidget(() => { + return grist.executeScriptInCustomWidget(() => { return (window as any).testGetCalendarEvent(eventId); }); } async function getCalendarViewName(): Promise { - return grist.inCustomWidget(() => { + return grist.executeScriptInCustomWidget(() => { return (window as any).testGetCalendarViewName(); }); } async function getDateVersion(): Promise { - return grist.inCustomWidget(() => { + return grist.executeScriptInCustomWidget(() => { return (window as any).testGetDataVersion(); }); } @@ -137,7 +137,7 @@ describe('calendar', function () { it('should navigate to appropriate time periods when button is pressed', async function () { const today = new Date(); const validateDate = async (daysToAdd: number) => { - const newDate = await grist.inCustomWidget(() => { + const newDate = await grist.executeScriptInCustomWidget(() => { return (window as any).calendarHandler.calendar.getDate().d.toDate().toDateString(); }); diff --git a/test/getGrist.ts b/test/getGrist.ts index fe38891a..ed72e5cf 100644 --- a/test/getGrist.ts +++ b/test/getGrist.ts @@ -277,4 +277,10 @@ export class GristUtils extends GristWebDriverUtils { public async getCustomWidgetBody(selector: string = 'html'): Promise { return this.inCustomWidget(() => this.driver.find(selector).getText()); } + + public async executeScriptInCustomWidget(script: () => Promise, ...args: any[]): Promise { + return this.inCustomWidget(() => { + return driver.executeScript(script, ...args); + }) + } } From 685ac6f76dcd1a374da5442908f4feffe6200b60 Mon Sep 17 00:00:00 2001 From: George Gevoian Date: Mon, 9 Oct 2023 22:17:35 -0400 Subject: [PATCH 09/16] Pass eventId to script --- test/calendar.ts | 12 ++++++------ test/getGrist.ts | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/test/calendar.ts b/test/calendar.ts index 9a1e050a..a88c4dcb 100644 --- a/test/calendar.ts +++ b/test/calendar.ts @@ -16,15 +16,15 @@ describe('calendar', function () { } async function getVisibleCalendarEvent(eventId: number): Promise { - return grist.executeScriptInCustomWidget(() => { - return (window as any).testGetVisibleCalendarEvent(eventId); - }); + return grist.executeScriptInCustomWidget((id: number) => { + return (window as any).testGetVisibleCalendarEvent(id); + }, eventId); } async function getCalendarEvent(eventId: number): Promise { - return grist.executeScriptInCustomWidget(() => { - return (window as any).testGetCalendarEvent(eventId); - }); + return grist.executeScriptInCustomWidget((id: number) => { + return (window as any).testGetCalendarEvent(id); + }, eventId); } async function getCalendarViewName(): Promise { diff --git a/test/getGrist.ts b/test/getGrist.ts index ed72e5cf..18daede2 100644 --- a/test/getGrist.ts +++ b/test/getGrist.ts @@ -278,7 +278,7 @@ export class GristUtils extends GristWebDriverUtils { return this.inCustomWidget(() => this.driver.find(selector).getText()); } - public async executeScriptInCustomWidget(script: () => Promise, ...args: any[]): Promise { + public async executeScriptInCustomWidget(script: Function, ...args: any[]): Promise { return this.inCustomWidget(() => { return driver.executeScript(script, ...args); }) From fa2e5193ff29ffcc2eb2a8a73f317d6e83a0f2fb Mon Sep 17 00:00:00 2001 From: George Gevoian Date: Mon, 9 Oct 2023 22:25:56 -0400 Subject: [PATCH 10/16] Revert JSON changes --- calendar/page.js | 4 ++-- test/calendar.ts | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/calendar/page.js b/calendar/page.js index b9e734af..a8af4246 100644 --- a/calendar/page.js +++ b/calendar/page.js @@ -687,7 +687,7 @@ function testGetCalendarEvent(eventId) { endDate: event.end, isAllDay: event.isAllday, }; - return eventData; + return JSON.stringify(eventData); } function testGetVisibleCalendarEvent(eventId) { @@ -701,7 +701,7 @@ function testGetVisibleCalendarEvent(eventId) { isAllDay: event?.isAllday ?? false, selected: event?.borderColor === calendarHandler._selectedColor, }; - return eventData; + return JSON.stringify(eventData); } function testGetCalendarViewName(){ diff --git a/test/calendar.ts b/test/calendar.ts index a88c4dcb..19b563c3 100644 --- a/test/calendar.ts +++ b/test/calendar.ts @@ -16,15 +16,17 @@ describe('calendar', function () { } async function getVisibleCalendarEvent(eventId: number): Promise { - return grist.executeScriptInCustomWidget((id: number) => { + const eventJSON = await grist.executeScriptInCustomWidget((id: number) => { return (window as any).testGetVisibleCalendarEvent(id); }, eventId); + return JSON.parse(eventJSON); } async function getCalendarEvent(eventId: number): Promise { - return grist.executeScriptInCustomWidget((id: number) => { + const eventJSON = await grist.executeScriptInCustomWidget((id: number) => { return (window as any).testGetCalendarEvent(id); }, eventId); + return JSON.parse(eventJSON); } async function getCalendarViewName(): Promise { From 1c3027728dc45ed10b7ba3d83bedd074583eafe5 Mon Sep 17 00:00:00 2001 From: George Gevoian Date: Mon, 9 Oct 2023 23:17:30 -0400 Subject: [PATCH 11/16] Move test code out of calendar widget --- calendar/page.js | 41 ++++------------------------------------- test/calendar.ts | 29 +++++++++++++++++++++++++---- 2 files changed, 29 insertions(+), 41 deletions(-) diff --git a/calendar/page.js b/calendar/page.js index a8af4246..67a24bcc 100644 --- a/calendar/page.js +++ b/calendar/page.js @@ -2,18 +2,16 @@ var grist; // to keep all calendar related logic; -let calendarHandler; -const CALENDAR_NAME = 'standardCalendar'; +var calendarHandler; + +var CALENDAR_NAME = 'standardCalendar'; const urlParams = new URLSearchParams(window.location.search); const isReadOnly = urlParams.get('readonly') === 'true' || (urlParams.has('access') && urlParams.get('access') !== 'full'); -//for tests +// for tests let dataVersion = Date.now(); -function testGetDataVersion(){ - return dataVersion; -} //registering code to run when a document is ready function ready(fn) { @@ -676,34 +674,3 @@ class ColTypesFetcher { } const colTypesFetcher = new ColTypesFetcher(); - -function testGetCalendarEvent(eventId) { - const event = calendarHandler.getEvents().get(eventId); - if (!event) { return null; } - - const eventData = { - title: event.title, - startDate: event.start, - endDate: event.end, - isAllDay: event.isAllday, - }; - return JSON.stringify(eventData); -} - -function testGetVisibleCalendarEvent(eventId) { - const event = calendarHandler.calendar.getEvent(eventId, CALENDAR_NAME); - if (!event) { return null; } - - const eventData = { - title: event?.title, - startDate: event?.start.d.d, - endDate: event?.end.d.d, - isAllDay: event?.isAllday ?? false, - selected: event?.borderColor === calendarHandler._selectedColor, - }; - return JSON.stringify(eventData); -} - -function testGetCalendarViewName(){ - return calendarHandler.calendar.getViewName(); -} diff --git a/test/calendar.ts b/test/calendar.ts index 19b563c3..a871b459 100644 --- a/test/calendar.ts +++ b/test/calendar.ts @@ -17,27 +17,48 @@ describe('calendar', function () { async function getVisibleCalendarEvent(eventId: number): Promise { const eventJSON = await grist.executeScriptInCustomWidget((id: number) => { - return (window as any).testGetVisibleCalendarEvent(id); + const calendarName = (window as any).CALENDAR_NAME; + const calendarHandler = (window as any).calendarHandler; + const event = calendarHandler.calendar.getEvent(id, calendarName); + if (!event) { return null; } + + const eventData = { + title: event?.title, + startDate: event?.start.d.d, + endDate: event?.end.d.d, + isAllDay: event?.isAllday ?? false, + selected: event?.borderColor === calendarHandler._selectedColor, + }; + return JSON.stringify(eventData); }, eventId); return JSON.parse(eventJSON); } async function getCalendarEvent(eventId: number): Promise { const eventJSON = await grist.executeScriptInCustomWidget((id: number) => { - return (window as any).testGetCalendarEvent(id); + const event = (window as any).calendarHandler.getEvents().get(id); + if (!event) { return null; } + + const eventData = { + title: event.title, + startDate: event.start, + endDate: event.end, + isAllDay: event.isAllday, + }; + return JSON.stringify(eventData); }, eventId); return JSON.parse(eventJSON); } async function getCalendarViewName(): Promise { return grist.executeScriptInCustomWidget(() => { - return (window as any).testGetCalendarViewName(); + return (window as any).calendarHandler.calendar.getViewName(); }); } async function getDateVersion(): Promise { return grist.executeScriptInCustomWidget(() => { - return (window as any).testGetDataVersion(); + return (window as any).dataVersion; }); } From e948cd7c6e093899ab7755e437875f8c268bf8a6 Mon Sep 17 00:00:00 2001 From: George Gevoian Date: Mon, 9 Oct 2023 23:23:43 -0400 Subject: [PATCH 12/16] Change let to var --- calendar/page.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/calendar/page.js b/calendar/page.js index 67a24bcc..618ed899 100644 --- a/calendar/page.js +++ b/calendar/page.js @@ -11,7 +11,7 @@ const isReadOnly = urlParams.get('readonly') === 'true' || (urlParams.has('access') && urlParams.get('access') !== 'full'); // for tests -let dataVersion = Date.now(); +var dataVersion = Date.now(); //registering code to run when a document is ready function ready(fn) { From df3765d3368dd331a4a500abbb908bef1310c305 Mon Sep 17 00:00:00 2001 From: George Gevoian Date: Wed, 11 Oct 2023 11:12:43 -0400 Subject: [PATCH 13/16] Fix failures after merge --- calendar/page.js | 5 +++-- test/calendar.ts | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/calendar/page.js b/calendar/page.js index 4e0d4c81..32437aff 100644 --- a/calendar/page.js +++ b/calendar/page.js @@ -710,9 +710,10 @@ async function updateCalendar(records, mappings) { if (mappedRecords) { const colTypes = await colTypesFetcher.getColTypes(); const colOptions = await colTypesFetcher.getColOptions(); - const events = mappedRecords.filter(isRecordValid).map(r => buildCalendarEventObject(r, colTypes, colOptions)); + const events = mappedRecords + .filter(isRecordValid) + .map(r => buildCalendarEventObject(r, colTypes, colOptions)); calendarHandler.setEvents(new Map(events.map(event => ([event.id, event])))); - calendarHandler.renderVisibleEvents(); updateUIAfterNavigation(); } dataVersion = Date.now(); diff --git a/test/calendar.ts b/test/calendar.ts index 973cb9f6..5c08ea70 100644 --- a/test/calendar.ts +++ b/test/calendar.ts @@ -349,7 +349,7 @@ describe('calendar', function () { const cell = driver.findContentWait(`.toastui-calendar-template-monthGridHeader`, String(day), 200); await driver.withActions(ac => // doubleClick doesn't work here, so we do two clicks instead. - ac.move({ origin: cell }).press().pause(100).release().pause(100).press().pause(100).release() + ac.move({origin: cell}).press().pause(100).release().pause(100).press().pause(100).release() ); }); } From 6b9486afd4eed769e0c255993557f7ae52e1f685 Mon Sep 17 00:00:00 2001 From: George Gevoian Date: Thu, 12 Oct 2023 00:50:03 -0400 Subject: [PATCH 14/16] Fix tests and a few other misc things --- .github/workflows/main.yml | 5 +- calendar/page.js | 8 + package.json | 10 +- test/calendar.ts | 39 ++-- test/getGrist.ts | 7 +- yarn.lock | 394 +++---------------------------------- 6 files changed, 61 insertions(+), 402 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 70e4413b..d6da6036 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -15,7 +15,7 @@ jobs: strategy: matrix: python-version: [3.9] - node-version: [16.x] + node-version: [18.x] steps: - uses: actions/checkout@v3 @@ -36,5 +36,8 @@ jobs: - name: Prepare for tests run: yarn run pretest + - name: Install chromedriver + run: ./node_modules/selenium-webdriver/bin/linux/selenium-manager --driver chromedriver + - name: Run tests run: MOCHA_WEBDRIVER_HEADLESS=1 yarn run test diff --git a/calendar/page.js b/calendar/page.js index 32437aff..4b0b6e75 100644 --- a/calendar/page.js +++ b/calendar/page.js @@ -788,6 +788,14 @@ class ColTypesFetcher { const colTypesFetcher = new ColTypesFetcher(); +function safeParse(value) { + try { + return JSON.parse(value); + } catch (err) { + return null; + } +} + function clean(obj) { return Object.fromEntries(Object.entries(obj).filter(([k, v]) => v !== undefined)); } diff --git a/package.json b/package.json index c7fc1931..72010e0b 100644 --- a/package.json +++ b/package.json @@ -12,26 +12,22 @@ "test": "docker image inspect gristlabs/grist --format 'gristlabs/grist image present' && NODE_PATH=_build SELENIUM_BROWSER=chrome mocha -g \"${GREP_TESTS}\" _build/test/*.js", "test:ci": "MOCHA_WEBDRIVER_HEADLESS=1 npm run test", "pretest": "docker pull gristlabs/grist && tsc --build && node ./buildtools/publish.js http://localhost:9998", - "grist": "docker run -t -i --rm --name grist-dev --network=host -e PORT=8484 -e GRIST_SINGLE_ORG=preview -e GRIST_WIDGET_LIST_URL=http://localhost:8585/manifest.json gristlabs/grist" + "grist": "docker run -t -i --rm --name grist-dev --add-host=host.docker.internal:host-gateway -e PORT=8484 -e GRIST_SINGLE_ORG=preview -e GRIST_WIDGET_LIST_URL=http://host.docker.internal:8585/manifest.json gristlabs/grist" }, "devDependencies": { "@types/chai": "^4.3.5", "@types/mocha": "^10.0.1", - "@types/node": "^20.3.1", + "@types/node": "18.11.9", "@types/node-fetch": "^2.6.4", "@types/selenium-webdriver": "^4.1.15", - "chromedriver": "114", "live-server": "^1.2.1", "mocha": "^10.2.0", - "mocha-webdriver": "^0.2.13", + "mocha-webdriver": "0.3.1", "node-fetch": "^2", "nodemon": "^2.0.15", "ts-node": "^10.9.1", "typescript": "^5.1.3" }, - "resolutions": { - "chromedriver": "114.0.2" - }, "dependencies": {}, "mocha": { "require": [ diff --git a/test/calendar.ts b/test/calendar.ts index 5c08ea70..2df39891 100644 --- a/test/calendar.ts +++ b/test/calendar.ts @@ -7,10 +7,10 @@ describe('calendar', function () { grist.bigScreen(); async function executeAndWaitForCalendar(action: () => Promise) { - const oldDataVersion = await getDateVersion(); + const oldDataVersion = await getDataVersion(); await action(); await driver.wait(async () => { - const dataVersion = await getDateVersion(); + const dataVersion = await getDataVersion(); return dataVersion > oldDataVersion; }); } @@ -27,7 +27,8 @@ describe('calendar', function () { startDate: event?.start.d.d, endDate: event?.end.d.d, isAllDay: event?.isAllday ?? false, - selected: event?.borderColor === calendarHandler._selectedColor, + selected: event?.borderColor === calendarHandler._selectedColor || + event?.backgroundColor === calendarHandler._selectedColor, }; return JSON.stringify(eventData); }, eventId); @@ -56,27 +57,27 @@ describe('calendar', function () { }); } - async function getDateVersion(): Promise { + async function getDataVersion(): Promise { return grist.executeScriptInCustomWidget(() => { return (window as any).dataVersion; }); } - before(async function () { - const docId = await grist.upload('test/fixtures/docs/Calendar.grist'); - await grist.openDoc(docId); - await grist.toggleSidePanel('right', 'open'); - await grist.addNewSection(/Custom/, /Table1/); - await grist.clickWidgetPane(); - await grist.selectCustomWidget(/Calendar/); - await grist.setCustomWidgetAccess('full'); - await grist.setCustomWidgetMapping('startDate', /From/); - await grist.setCustomWidgetMapping('endDate', /To/); - await grist.setCustomWidgetMapping('title', /Label/); - await grist.setCustomWidgetMapping('isAllDay', /IsFullDay/); - //sign in to grist - await grist.login(); - }); + before(async function () { + const docId = await grist.upload('test/fixtures/docs/Calendar.grist'); + await grist.openDoc(docId); + await grist.toggleSidePanel('right', 'open'); + await grist.addNewSection(/Custom/, /Table1/); + await grist.clickWidgetPane(); + await grist.selectCustomWidget(/Calendar/); + await grist.setCustomWidgetAccess('full'); + await grist.setCustomWidgetMapping('startDate', /From/); + await grist.setCustomWidgetMapping('endDate', /To/); + await grist.setCustomWidgetMapping('title', /Label/); + await grist.setCustomWidgetMapping('isAllDay', /IsFullDay/); + //sign in to grist + await grist.login(); + }); it('should create new event when new row is added', async function () { await executeAndWaitForCalendar(async () => { diff --git a/test/getGrist.ts b/test/getGrist.ts index 7146760e..cad3ccaa 100644 --- a/test/getGrist.ts +++ b/test/getGrist.ts @@ -63,10 +63,10 @@ export class GristTestServer { await this.stop(); const {gristContainerName, gristImage, gristPort, contentPort} = serverSettings; const cmd = `docker run -d --rm --name ${gristContainerName}` + - ` --network="host"` + + ' --add-host=host.docker.internal:host-gateway' + ` -e PORT=${gristPort} -p ${gristPort}:${gristPort}` + ` -e GRIST_SINGLE_ORG=${serverSettings.site}` + - ` -e GRIST_WIDGET_LIST_URL=http://localhost:${contentPort}/manifest.json` + + ` -e GRIST_WIDGET_LIST_URL=http://host.docker.internal:${contentPort}/manifest.json` + ` ${gristImage}`; try { execSync(cmd, { @@ -117,7 +117,8 @@ export class GristTestServer { public get assetUrl() { const {contentPort} = serverSettings; - return `http://localhost:${contentPort}`; + // localhost doesn't work on Node 18 (see https://github.com/node-fetch/node-fetch/issues/1624) + return `http://127.0.0.1:${contentPort}`; } } diff --git a/yarn.lock b/yarn.lock index bb478336..bcdc6e2e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -32,11 +32,6 @@ resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-0.14.0.tgz#9fb3a3cf3132328151f353de4632e01e52102bea" integrity sha512-9NET910DNaIPngYnLLPeg+Ogzqsi9uM4mSboU5y6p8S5DzMTVEsJZrawi+BoDNUVBa2DhJqQYUFvMDfgU062LQ== -"@sindresorhus/is@^4.0.0": - version "4.6.0" - resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-4.6.0.tgz#3c7c9c46e678feefe7a2e5bb609d3dbd665ffb3f" - integrity sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw== - "@szmarczak/http-timer@^1.1.2": version "1.1.2" resolved "https://registry.yarnpkg.com/@szmarczak/http-timer/-/http-timer-1.1.2.tgz#b1665e2c461a2cd92f4c1bbf50d5454de0d4b421" @@ -44,18 +39,6 @@ dependencies: defer-to-connect "^1.0.1" -"@szmarczak/http-timer@^4.0.5": - version "4.0.6" - resolved "https://registry.yarnpkg.com/@szmarczak/http-timer/-/http-timer-4.0.6.tgz#b4a914bb62e7c272d4e5989fe4440f812ab1d807" - integrity sha512-4BAffykYOgO+5nzBWYwE3W90sBgLJoUPRWWcL8wlyiM8IB8ipJz3UMJ9KXQd1RKQXpKp8Tutn80HZtWsu2u76w== - dependencies: - defer-to-connect "^2.0.0" - -"@testim/chrome-version@^1.1.3": - version "1.1.3" - resolved "https://registry.yarnpkg.com/@testim/chrome-version/-/chrome-version-1.1.3.tgz#fbb68696899d7b8c1b9b891eded9c04fe2cd5529" - integrity sha512-g697J3WxV/Zytemz8aTuKjTGYtta9+02kva3C1xc7KXB8GdbfE1akGJIsZLyY/FSh2QrnE+fiB7vmWU3XNcb6A== - "@tsconfig/node10@^1.0.7": version "1.0.9" resolved "https://registry.yarnpkg.com/@tsconfig/node10/-/node10-1.0.9.tgz#df4907fc07a886922637b15e02d4cebc4c0021b2" @@ -76,33 +59,11 @@ resolved "https://registry.yarnpkg.com/@tsconfig/node16/-/node16-1.0.4.tgz#0b92dcc0cc1c81f6f306a381f28e31b1a56536e9" integrity sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA== -"@types/cacheable-request@^6.0.1": - version "6.0.3" - resolved "https://registry.yarnpkg.com/@types/cacheable-request/-/cacheable-request-6.0.3.tgz#a430b3260466ca7b5ca5bfd735693b36e7a9d183" - integrity sha512-IQ3EbTzGxIigb1I3qPZc1rWJnH0BmSKv5QYTalEwweFvyBDLSAe24zP0le/hyi7ecGfZVlIVAg4BZqb8WBwKqw== - dependencies: - "@types/http-cache-semantics" "*" - "@types/keyv" "^3.1.4" - "@types/node" "*" - "@types/responselike" "^1.0.0" - "@types/chai@^4.3.5": version "4.3.5" resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.3.5.tgz#ae69bcbb1bebb68c4ac0b11e9d8ed04526b3562b" integrity sha512-mEo1sAde+UCE6b2hxn332f1g1E8WfYRu6p5SvTKr2ZKC1f7gFJXk4h5PyGP9Dt6gCaG8y8XhwnXWC6Iy2cmBng== -"@types/http-cache-semantics@*": - version "4.0.1" - resolved "https://registry.yarnpkg.com/@types/http-cache-semantics/-/http-cache-semantics-4.0.1.tgz#0ea7b61496902b95890dc4c3a116b60cb8dae812" - integrity sha512-SZs7ekbP8CN0txVG2xVRH6EgKmEm31BOxA07vkFaETzZz1xh+cbt8BcI0slpymvwhx5dlFnQG2rTlPVQn+iRPQ== - -"@types/keyv@^3.1.4": - version "3.1.4" - resolved "https://registry.yarnpkg.com/@types/keyv/-/keyv-3.1.4.tgz#3ccdb1c6751b0c7e52300bcdacd5bcbf8faa75b6" - integrity sha512-BQ5aZNSCpj7D6K2ksrRCTmKRLEpnPvWDiLPfoGyhZ++8YtiK9d/3DBKPJgry359X/P1PfruyYwvnvwFjuEiEIg== - dependencies: - "@types/node" "*" - "@types/mocha@^10.0.1": version "10.0.1" resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-10.0.1.tgz#2f4f65bb08bc368ac39c96da7b2f09140b26851b" @@ -116,17 +77,15 @@ "@types/node" "*" form-data "^3.0.0" -"@types/node@*", "@types/node@^20.3.1": +"@types/node@*": version "20.3.1" resolved "https://registry.yarnpkg.com/@types/node/-/node-20.3.1.tgz#e8a83f1aa8b649377bb1fb5d7bac5cb90e784dfe" integrity sha512-EhcH/wvidPy1WeML3TtYFGR83UzjxeWRen9V402T8aUGYsCHOmfoisV3ZSg03gAFIbLq8TnWOJ0f4cALtnSEUg== -"@types/responselike@^1.0.0": - version "1.0.0" - resolved "https://registry.yarnpkg.com/@types/responselike/-/responselike-1.0.0.tgz#251f4fe7d154d2bad125abe1b429b23afd262e29" - integrity sha512-85Y2BjiufFzaMIlvJDvTTB8Fxl2xfLo4HgmHzVBz08w4wDePCTjYw66PdrolO0kzli3yam/YCgRufyo1DdQVTA== - dependencies: - "@types/node" "*" +"@types/node@18.11.9": + version "18.11.9" + resolved "https://registry.yarnpkg.com/@types/node/-/node-18.11.9.tgz#02d013de7058cea16d36168ef2fc653464cfbad4" + integrity sha512-CRpX21/kGdzjOpFsZSkcrXMGIBWMGNIHXXBVFSH+ggkftxg+XYP20TESbh+zFvFj3EQOl5byk0HTRn1IL6hbqg== "@types/selenium-webdriver@^4.1.15": version "4.1.15" @@ -142,13 +101,6 @@ dependencies: "@types/node" "*" -"@types/yauzl@^2.9.1": - version "2.10.0" - resolved "https://registry.yarnpkg.com/@types/yauzl/-/yauzl-2.10.0.tgz#b3248295276cf8c6f153ebe6a9aba0c988cb2599" - integrity sha512-Cn6WYCm0tXv8p6k+A8PvbDG763EDpBoTzHdA+Q/MF6H3sapGjCm9NzoaJncJS9tUKSuCoDs9XHxYYsQDgxR6kw== - dependencies: - "@types/node" "*" - abbrev@1: version "1.1.1" resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" @@ -172,18 +124,6 @@ acorn@^8.4.1: resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.9.0.tgz#78a16e3b2bcc198c10822786fa6679e245db5b59" integrity sha512-jaVNAFBHNLXspO543WnNNPZFRtavh3skAkITqD0/2aeMkKZTN+254PyhwxFYrk3vQ1xfY+2wbesJMs/JC8/PwQ== -adm-zip@0.5.9: - version "0.5.9" - resolved "https://registry.yarnpkg.com/adm-zip/-/adm-zip-0.5.9.tgz#b33691028333821c0cf95c31374c5462f2905a83" - integrity sha512-s+3fXLkeeLjZ2kLjCBwQufpI5fuN+kIGBxu6530nVQZGVol0d7Y/M88/xw9HGGUcJjKf8LutN3VPRUBq6N7Ajg== - -agent-base@6: - version "6.0.2" - resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-6.0.2.tgz#49fff58577cfee3f37176feab4c22e00f86d7f77" - integrity sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ== - dependencies: - debug "4" - ansi-align@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/ansi-align/-/ansi-align-3.0.1.tgz#0cdf12e111ace773a86e9a1fad1225c43cb19a59" @@ -291,15 +231,6 @@ atob@^2.1.2: resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9" integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg== -axios@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/axios/-/axios-1.4.0.tgz#38a7bf1224cd308de271146038b551d725f0be1f" - integrity sha512-S4XCWMEmzvo64T9GfvQDOXgYRDJ/wsSZc7Jvdgx5u1sd0JwsuPLqb3SYmusag+edF6ziyMensPVqLTSc1PiSEA== - dependencies: - follow-redirects "^1.15.0" - form-data "^4.0.0" - proxy-from-env "^1.1.0" - balanced-match@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" @@ -352,11 +283,6 @@ bindings@^1.5.0: dependencies: file-uri-to-path "1.0.0" -bluebird@3.7.2: - version "3.7.2" - resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.2.tgz#9f229c15be272454ffa973ace0dbee79a1b0c36f" - integrity sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg== - boxen@^5.0.0: version "5.1.2" resolved "https://registry.yarnpkg.com/boxen/-/boxen-5.1.2.tgz#788cb686fc83c1f486dfa8a40c68fc2b831d2b50" @@ -414,11 +340,6 @@ browser-stdout@1.3.1: resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.1.tgz#baa559ee14ced73452229bad7326467c61fabd60" integrity sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw== -buffer-crc32@~0.2.3: - version "0.2.13" - resolved "https://registry.yarnpkg.com/buffer-crc32/-/buffer-crc32-0.2.13.tgz#0d333e3f00eac50aa1454abd30ef8c2a5d9a7242" - integrity sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ== - cache-base@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/cache-base/-/cache-base-1.0.1.tgz#0a7f46416831c8b662ee36fe4e7c59d76f666ab2" @@ -434,11 +355,6 @@ cache-base@^1.0.1: union-value "^1.0.0" unset-value "^1.0.0" -cacheable-lookup@^5.0.3: - version "5.0.4" - resolved "https://registry.yarnpkg.com/cacheable-lookup/-/cacheable-lookup-5.0.4.tgz#5a6b865b2c44357be3d5ebc2a467b032719a7005" - integrity sha512-2/kNscPhpcxrOigMZzbiWF7dz8ilhb/nIHU3EyZiXWXpeq/au8qJ8VhdftMkty3n7Gj6HIGalQG8oiBNB3AJgA== - cacheable-request@^6.0.0: version "6.1.0" resolved "https://registry.yarnpkg.com/cacheable-request/-/cacheable-request-6.1.0.tgz#20ffb8bd162ba4be11e9567d823db651052ca912" @@ -452,19 +368,6 @@ cacheable-request@^6.0.0: normalize-url "^4.1.0" responselike "^1.0.2" -cacheable-request@^7.0.2: - version "7.0.4" - resolved "https://registry.yarnpkg.com/cacheable-request/-/cacheable-request-7.0.4.tgz#7a33ebf08613178b403635be7b899d3e69bbe817" - integrity sha512-v+p6ongsrp0yTGbJXjgxPow2+DL93DASP4kXCDKb8/bwRtt9OEF3whggkkDkGNzgcWy2XaF4a8nZglC7uElscg== - dependencies: - clone-response "^1.0.2" - get-stream "^5.1.0" - http-cache-semantics "^4.0.0" - keyv "^4.0.0" - lowercase-keys "^2.0.0" - normalize-url "^6.0.1" - responselike "^2.0.0" - camelcase@^6.0.0: version "6.3.0" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" @@ -557,24 +460,6 @@ chokidar@^3.5.2: optionalDependencies: fsevents "~2.3.2" -chownr@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/chownr/-/chownr-2.0.0.tgz#15bfbe53d2eab4cf70f18a8cd68ebe5b3cb1dece" - integrity sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ== - -chromedriver@114, chromedriver@114.0.2, chromedriver@^74.0.0: - version "114.0.2" - resolved "https://registry.yarnpkg.com/chromedriver/-/chromedriver-114.0.2.tgz#1ddaa6738f2b60e6b832a39f791c8c54bf840837" - integrity sha512-v0qrXRBknbxqmtklG7RWOe3TJ/dLaHhtB0jVxE7BAdYERxUjEaNRyqBwoGgVfQDibHCB0swzvzsj158nnfPgZw== - dependencies: - "@testim/chrome-version" "^1.1.3" - axios "^1.4.0" - compare-versions "^5.0.3" - extract-zip "^2.0.1" - https-proxy-agent "^5.0.1" - proxy-from-env "^1.1.0" - tcp-port-used "^1.0.1" - ci-info@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46" @@ -643,11 +528,6 @@ combined-stream@^1.0.8: dependencies: delayed-stream "~1.0.0" -compare-versions@^5.0.3: - version "5.0.3" - resolved "https://registry.yarnpkg.com/compare-versions/-/compare-versions-5.0.3.tgz#a9b34fea217472650ef4a2651d905f42c28ebfd7" - integrity sha512-4UZlZP8Z99MGEY+Ovg/uJxJuvoXuN4M6B3hKaiackiHrgzQFEe3diJi1mf1PNHbFujM7FvLrK2bpgIaImbtZ1A== - component-emitter@^1.2.1: version "1.3.0" resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.3.0.tgz#16e4070fba8ae29b679f2215853ee181ab2eabc0" @@ -715,20 +595,13 @@ debug@2.6.9, debug@^2.2.0, debug@^2.3.3: dependencies: ms "2.0.0" -debug@4, debug@4.3.4, debug@^4.1.1: +debug@4.3.4: version "4.3.4" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== dependencies: ms "2.1.2" -debug@4.3.1: - version "4.3.1" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.1.tgz#f0d229c505e0c6d8c49ac553d1b13dc183f6b2ee" - integrity sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ== - dependencies: - ms "2.1.2" - debug@^3.2.7: version "3.2.7" resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.7.tgz#72580b7e9145fb39b6676f9c5e5fb100b934179a" @@ -753,13 +626,6 @@ decompress-response@^3.3.0: dependencies: mimic-response "^1.0.0" -decompress-response@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/decompress-response/-/decompress-response-6.0.0.tgz#ca387612ddb7e104bd16d85aab00d5ecf09c66fc" - integrity sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ== - dependencies: - mimic-response "^3.1.0" - deep-eql@^4.1.2: version "4.1.3" resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-4.1.3.tgz#7c7775513092f7df98d8df9996dd085eb668cc6d" @@ -772,21 +638,11 @@ deep-extend@^0.6.0: resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" integrity sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA== -deep-is@^0.1.3: - version "0.1.4" - resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.4.tgz#a6f2dce612fadd2ef1f519b73551f17e85199831" - integrity sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ== - defer-to-connect@^1.0.1: version "1.1.3" resolved "https://registry.yarnpkg.com/defer-to-connect/-/defer-to-connect-1.1.3.tgz#331ae050c08dcf789f8c83a7b81f0ed94f4ac591" integrity sha512-0ISdNousHvZT2EiFlZeZAHBUvSxmKswVCEf8hW7KWgG4a8MVEu/3Vb6uWYozkjylyCxe0JBIiRB1jV45S70WVQ== -defer-to-connect@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/defer-to-connect/-/defer-to-connect-2.0.1.tgz#8016bdb4143e4632b77a3449c6236277de520587" - integrity sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg== - define-property@^0.2.5: version "0.2.5" resolved "https://registry.yarnpkg.com/define-property/-/define-property-0.2.5.tgz#c35b1ef918ec3c990f9a5bc57be04aacec5c8116" @@ -958,17 +814,6 @@ extglob@^2.0.4: snapdragon "^0.8.1" to-regex "^3.0.1" -extract-zip@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/extract-zip/-/extract-zip-2.0.1.tgz#663dca56fe46df890d5f131ef4a06d22bb8ba13a" - integrity sha512-GDhU9ntwuKyGXdZBUgTIe+vXnWj0fppUEtMDL0+idd5Sta8TGpHssn/eusA9mrPr9qNDym6SxAYZjNvCn/9RBg== - dependencies: - debug "^4.1.1" - get-stream "^5.1.0" - yauzl "^2.10.0" - optionalDependencies: - "@types/yauzl" "^2.9.1" - faye-websocket@0.11.x: version "0.11.4" resolved "https://registry.yarnpkg.com/faye-websocket/-/faye-websocket-0.11.4.tgz#7f0d9275cfdd86a1c963dc8b65fcc451edcbb1da" @@ -976,13 +821,6 @@ faye-websocket@0.11.x: dependencies: websocket-driver ">=0.5.1" -fd-slicer@~1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/fd-slicer/-/fd-slicer-1.1.0.tgz#25c7c89cb1f9077f8891bbe61d8f390eae256f1e" - integrity sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g== - dependencies: - pend "~1.2.0" - file-uri-to-path@1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz#553a7b8446ff6f684359c445f1e37a05dacc33dd" @@ -1031,11 +869,6 @@ flat@^5.0.2: resolved "https://registry.yarnpkg.com/flat/-/flat-5.0.2.tgz#8ca6fe332069ffa9d324c327198c598259ceb241" integrity sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ== -follow-redirects@^1.15.0: - version "1.15.2" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.2.tgz#b460864144ba63f2681096f274c4e57026da2c13" - integrity sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA== - for-in@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" @@ -1050,15 +883,6 @@ form-data@^3.0.0: combined-stream "^1.0.8" mime-types "^2.1.12" -form-data@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.0.tgz#93919daeaf361ee529584b9b31664dc12c9fa452" - integrity sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww== - dependencies: - asynckit "^0.4.0" - combined-stream "^1.0.8" - mime-types "^2.1.12" - fragment-cache@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/fragment-cache/-/fragment-cache-0.2.1.tgz#4290fad27f13e89be7f33799c6bc5a0abfff0d19" @@ -1085,13 +909,6 @@ fs-extra@^8.0.1: jsonfile "^4.0.0" universalify "^0.1.0" -fs-minipass@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-2.1.0.tgz#7f5036fdbf12c63c169190cbe4199c852271f9fb" - integrity sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg== - dependencies: - minipass "^3.0.0" - fs.realpath@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" @@ -1110,17 +927,6 @@ fsevents@~2.3.2: resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== -geckodriver@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/geckodriver/-/geckodriver-3.2.0.tgz#6b0a85e2aafbce209bca30e2d53af857707b1034" - integrity sha512-p+qR2RKlI/TQoCEYrSuTaYCLqsJNni96WmEukTyXmOmLn+3FLdgPAEwMZ0sG2Cwi9hozUzGAWyT6zLuhF6cpiQ== - dependencies: - adm-zip "0.5.9" - bluebird "3.7.2" - got "11.8.5" - https-proxy-agent "5.0.1" - tar "6.1.11" - get-caller-file@^2.0.5: version "2.0.5" resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" @@ -1196,23 +1002,6 @@ global-dirs@^3.0.0: dependencies: ini "2.0.0" -got@11.8.5: - version "11.8.5" - resolved "https://registry.yarnpkg.com/got/-/got-11.8.5.tgz#ce77d045136de56e8f024bebb82ea349bc730046" - integrity sha512-o0Je4NvQObAuZPHLFoRSkdG2lTgtcynqymzg2Vupdx6PorhaT5MCbIyXG6d4D94kk8ZG57QeosgdiqfJWhEhlQ== - dependencies: - "@sindresorhus/is" "^4.0.0" - "@szmarczak/http-timer" "^4.0.5" - "@types/cacheable-request" "^6.0.1" - "@types/responselike" "^1.0.0" - cacheable-lookup "^5.0.3" - cacheable-request "^7.0.2" - decompress-response "^6.0.0" - http2-wrapper "^1.0.0-beta.5.2" - lowercase-keys "^2.0.0" - p-cancelable "^2.0.0" - responselike "^2.0.0" - got@^9.6.0: version "9.6.0" resolved "https://registry.yarnpkg.com/got/-/got-9.6.0.tgz#edf45e7d67f99545705de1f7bbeeeb121765ed85" @@ -1332,22 +1121,6 @@ http-parser-js@>=0.5.1: resolved "https://registry.yarnpkg.com/http-parser-js/-/http-parser-js-0.5.5.tgz#d7c30d5d3c90d865b4a2e870181f9d6f22ac7ac5" integrity sha512-x+JVEkO2PoM8qqpbPbOL3cqHPwerep7OwzK7Ay+sMQjKzaKCqWvjoXm5tqMP9tXWWTnTzAjIhXg+J99XYuPhPA== -http2-wrapper@^1.0.0-beta.5.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/http2-wrapper/-/http2-wrapper-1.0.3.tgz#b8f55e0c1f25d4ebd08b3b0c2c079f9590800b3d" - integrity sha512-V+23sDMr12Wnz7iTcDeJr3O6AIxlnvT/bmaAAAP/Xda35C90p9599p0F1eHR/N1KILWSoWVAiOMFjBBXaXSMxg== - dependencies: - quick-lru "^5.1.1" - resolve-alpn "^1.0.0" - -https-proxy-agent@5.0.1, https-proxy-agent@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz#c59ef224a04fe8b754f3db0063a25ea30d0005d6" - integrity sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA== - dependencies: - agent-base "6" - debug "4" - ignore-by-default@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/ignore-by-default/-/ignore-by-default-1.0.1.tgz#48ca6d72f6c6a3af00a9ad4ae6876be3889e2b09" @@ -1396,11 +1169,6 @@ ini@~1.3.0: resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.8.tgz#a29da425b48806f34767a4efce397269af28432c" integrity sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew== -ip-regex@^4.1.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/ip-regex/-/ip-regex-4.3.0.tgz#687275ab0f57fa76978ff8f4dddc8a23d5990db5" - integrity sha512-B9ZWJxHHOHUhUjCPrMpLD4xEq35bUTClHM1S6CBU5ixQnkZmwipwgc96vAd7AAGM9TGHvJR+Uss+/Ak6UphK+Q== - is-accessor-descriptor@^0.1.6: version "0.1.6" resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6" @@ -1566,11 +1334,6 @@ is-unicode-supported@^0.1.0: resolved "https://registry.yarnpkg.com/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz#3f26c76a809593b52bfa2ecb5710ed2779b522a7" integrity sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw== -is-url@^1.2.4: - version "1.2.4" - resolved "https://registry.yarnpkg.com/is-url/-/is-url-1.2.4.tgz#04a4df46d28c4cff3d73d01ff06abeb318a1aa52" - integrity sha512-ITvGim8FhRiYe4IQ5uHSkj7pVaPDrCTkNd3yq3cV7iZAcJdHTUMPMEHcqSOy9xZ9qFenQCvi+2wjH9a1nXqHww== - is-windows@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" @@ -1586,15 +1349,6 @@ is-yarn-global@^0.3.0: resolved "https://registry.yarnpkg.com/is-yarn-global/-/is-yarn-global-0.3.0.tgz#d502d3382590ea3004893746754c89139973e232" integrity sha512-VjSeb/lHmkoyd8ryPVIKvOCn4D1koMqY+vqyjjUfc3xyKtP4dYOxM44sZrnqQSzSds3xyOrUTLTC9LVCVgLngw== -is2@^2.0.6: - version "2.0.9" - resolved "https://registry.yarnpkg.com/is2/-/is2-2.0.9.tgz#ff63b441f90de343fa8fac2125ee170da8e8240d" - integrity sha512-rZkHeBn9Zzq52sd9IUIV3a5mfwBY+o2HePMh0wkGBM4z4qjvy2GwVxQ6nNXSfw6MmVP6gf1QIlWjiOavhM3x5g== - dependencies: - deep-is "^0.1.3" - ip-regex "^4.1.0" - is-url "^1.2.4" - isarray@1.0.0, isarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" @@ -1624,11 +1378,6 @@ json-buffer@3.0.0: resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.0.tgz#5b1f397afc75d677bde8bcfc0e47e1f9a3d9a898" integrity sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg= -json-buffer@3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.1.tgz#9338802a30d3b6605fbe0613e094008ca8c05a13" - integrity sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ== - jsonfile@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb" @@ -1653,13 +1402,6 @@ keyv@^3.0.0: dependencies: json-buffer "3.0.0" -keyv@^4.0.0: - version "4.5.2" - resolved "https://registry.yarnpkg.com/keyv/-/keyv-4.5.2.tgz#0e310ce73bf7851ec702f2eaf46ec4e3805cce56" - integrity sha512-5MHbFaKn8cNSmVW7BYnijeAVlE4cYA/SVkifVgrh7yotnfhKmjuXpDKjrABLnT0SfHWV21P8ow07OGfRrNDg8g== - dependencies: - json-buffer "3.0.1" - kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0: version "3.2.2" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" @@ -1838,11 +1580,6 @@ mimic-response@^1.0.0, mimic-response@^1.0.1: resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-1.0.1.tgz#4923538878eef42063cb8a3e3b0798781487ab1b" integrity sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ== -mimic-response@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-3.1.0.tgz#2d1d59af9c1b129815accc2c46a022a5ce1fa3c9" - integrity sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ== - minimatch@5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-5.0.1.tgz#fb9022f7528125187c92bd9e9b6366be1cf3415b" @@ -1869,21 +1606,6 @@ minimist@^1.2.0: resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== -minipass@^3.0.0: - version "3.3.6" - resolved "https://registry.yarnpkg.com/minipass/-/minipass-3.3.6.tgz#7bba384db3a1520d18c9c0e5251c3444e95dd94a" - integrity sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw== - dependencies: - yallist "^4.0.0" - -minizlib@^2.1.1: - version "2.1.2" - resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-2.1.2.tgz#e90d3466ba209b932451508a11ce3d3632145931" - integrity sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg== - dependencies: - minipass "^3.0.0" - yallist "^4.0.0" - mixin-deep@^1.2.0: version "1.3.2" resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.2.tgz#1120b43dc359a785dce65b55b82e257ccf479566" @@ -1892,26 +1614,19 @@ mixin-deep@^1.2.0: for-in "^1.0.2" is-extendable "^1.0.1" -mkdirp@^1.0.3: - version "1.0.4" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" - integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== - -mocha-webdriver@^0.2.13: - version "0.2.13" - resolved "https://registry.yarnpkg.com/mocha-webdriver/-/mocha-webdriver-0.2.13.tgz#6e39360e08dc32e2de7375c6eaee83bd6aa98cc6" - integrity sha512-xSQ9fTViIucIZs+loRzKhOkUtztMheHYRg2+CrgqBPg9/MYjOWbcUk+uye5r117BN/r57KRuZxvsZRH0Jm0gCg== +mocha-webdriver@0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/mocha-webdriver/-/mocha-webdriver-0.3.1.tgz#5ed238e710ee2e4dfe72208cdd1dc4a15d2aa644" + integrity sha512-4apKuGdB72aEqnT2LdspLCOGXpWui5EJ/mVsw9UcI8ps2SkKHAhHZtHf05CKuTmQJJZcDa2mpcP4oXNXXDsZlA== dependencies: chai "^4.1.2" chai-as-promised "^7.1.1" - chromedriver "^74.0.0" fs-extra "^8.0.1" - geckodriver "^3.2.0" - mocha "^10.1.0" + mocha "^10.2.0" npm-run-path "^3.1.0" - selenium-webdriver "^4.0.0-alpha.1" + selenium-webdriver "^4.11.1" -mocha@^10.1.0, mocha@^10.2.0: +mocha@^10.2.0: version "10.2.0" resolved "https://registry.yarnpkg.com/mocha/-/mocha-10.2.0.tgz#1fd4a7c32ba5ac372e03a17eef435bd00e5c68b8" integrity sha512-IDY7fl/BecMwFHzoqF2sg/SHHANeBoMMXFlS9r0OXKDssYE1M5O43wUY/9BVPeIvfH2zmEbBfseqN9gBQZzXkg== @@ -2048,11 +1763,6 @@ normalize-url@^4.1.0: resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-4.5.1.tgz#0dd90cf1288ee1d1313b87081c9a5932ee48518a" integrity sha512-9UZCFRHQdNrfTpGg8+1INIg93B6zE0aXMVFkw1WFwvO4SlZywU6aLg5Of0Ap/PgcbSw4LNxvMWXMeugwMCX0AA== -normalize-url@^6.0.1: - version "6.1.0" - resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-6.1.0.tgz#40d0885b535deffe3f3147bec877d05fe4c5668a" - integrity sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A== - npm-run-path@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-3.1.0.tgz#7f91be317f6a466efed3c9f2980ad8a4ee8b0fa5" @@ -2119,11 +1829,6 @@ p-cancelable@^1.0.0: resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-1.1.0.tgz#d078d15a3af409220c886f1d9a0ca2e441ab26cc" integrity sha512-s73XxOZ4zpt1edZYZzvhqFa6uvQc1vwUa0K0BdtIZgQMAJj9IbebH+JkgKZc9h+B05PKHLOTl4ajG1BmNrVZlw== -p-cancelable@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-2.1.1.tgz#aab7fbd416582fa32a3db49859c122487c5ed2cf" - integrity sha512-BZOr3nRQHOntUjTrH8+Lh54smKHoHyur8We1V8DSMVrl5A2malOOwuJRnKRDjSnkoeBh4at6BwEnb5I7Jl31wg== - p-limit@^3.0.2: version "3.1.0" resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b" @@ -2195,11 +1900,6 @@ pause-stream@0.0.11: dependencies: through "~2.3" -pend@~1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/pend/-/pend-1.2.0.tgz#7a57eb550a6783f9115331fcf4663d5c8e007a50" - integrity sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg== - picomatch@^2.0.4, picomatch@^2.2.1: version "2.3.0" resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.0.tgz#f1f061de8f6a4bf022892e2d128234fb98302972" @@ -2220,11 +1920,6 @@ process-nextick-args@~2.0.0: resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag== -proxy-from-env@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2" - integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg== - proxy-middleware@latest: version "0.15.0" resolved "https://registry.yarnpkg.com/proxy-middleware/-/proxy-middleware-0.15.0.tgz#a3fdf1befb730f951965872ac2f6074c61477a56" @@ -2250,11 +1945,6 @@ pupa@^2.1.1: dependencies: escape-goat "^2.0.0" -quick-lru@^5.1.1: - version "5.1.1" - resolved "https://registry.yarnpkg.com/quick-lru/-/quick-lru-5.1.1.tgz#366493e6b3e42a3a6885e2e99d18f80fb7a8c932" - integrity sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA== - randombytes@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" @@ -2361,11 +2051,6 @@ require-directory@^2.1.1: resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" integrity sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q== -resolve-alpn@^1.0.0: - version "1.2.1" - resolved "https://registry.yarnpkg.com/resolve-alpn/-/resolve-alpn-1.2.1.tgz#b7adbdac3546aaaec20b45e7d8265927072726f9" - integrity sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g== - resolve-url@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" @@ -2378,13 +2063,6 @@ responselike@^1.0.2: dependencies: lowercase-keys "^1.0.0" -responselike@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/responselike/-/responselike-2.0.1.tgz#9a0bc8fdc252f3fb1cca68b016591059ba1422bc" - integrity sha512-4gl03wn3hj1HP3yzgdI7d3lCkF95F21Pz4BPGvKHinyQzALR5CapwC8yIi0Rh58DEMQ/SguC03wFj2k0M/mHhw== - dependencies: - lowercase-keys "^2.0.0" - ret@~0.1.10: version "0.1.15" resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" @@ -2414,14 +2092,14 @@ safe-regex@^1.1.0: dependencies: ret "~0.1.10" -selenium-webdriver@^4.0.0-alpha.1: - version "4.10.0" - resolved "https://registry.yarnpkg.com/selenium-webdriver/-/selenium-webdriver-4.10.0.tgz#0508cdfbb5ad8470d8fd19db1a69d3e87f474b79" - integrity sha512-hSQPw6jgc+ej/UEcdQPG/iBwwMeCEgZr9HByY/J8ToyXztEqXzU9aLsIyrlj1BywBcStO4JQK/zMUWWrV8+riA== +selenium-webdriver@^4.11.1: + version "4.14.0" + resolved "https://registry.yarnpkg.com/selenium-webdriver/-/selenium-webdriver-4.14.0.tgz#d39917cd7c1bb30f753c1f668158f37d1905fafc" + integrity sha512-637rs8anqMKHbWxcBZpyG3Gcs+rBUtAUiqk0O/knUqH4Paj3MFUZrz88/pVGOLNryEVy2z92fZomT8p1ENl1gA== dependencies: jszip "^3.10.1" tmp "^0.2.1" - ws ">=8.13.0" + ws ">=8.14.2" semver-diff@^3.1.1: version "3.1.1" @@ -2655,26 +2333,6 @@ supports-color@^7.1.0: dependencies: has-flag "^4.0.0" -tar@6.1.11: - version "6.1.11" - resolved "https://registry.yarnpkg.com/tar/-/tar-6.1.11.tgz#6760a38f003afa1b2ffd0ffe9e9abbd0eab3d621" - integrity sha512-an/KZQzQUkZCkuoAA64hM92X0Urb6VpRhAFllDzz44U2mcD5scmT3zBc4VgVpkugF580+DQn8eAFSyoQt0tznA== - dependencies: - chownr "^2.0.0" - fs-minipass "^2.0.0" - minipass "^3.0.0" - minizlib "^2.1.1" - mkdirp "^1.0.3" - yallist "^4.0.0" - -tcp-port-used@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/tcp-port-used/-/tcp-port-used-1.0.2.tgz#9652b7436eb1f4cfae111c79b558a25769f6faea" - integrity sha512-l7ar8lLUD3XS1V2lfoJlCBaeoaWo/2xfYt81hM7VlvR4RrMVFqfmzfhLVk40hAb368uitje5gPtBRL1m/DGvLA== - dependencies: - debug "4.3.1" - is2 "^2.0.6" - through@2, through@~2.3, through@~2.3.1: version "2.3.8" resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" @@ -2957,10 +2615,10 @@ write-file-atomic@^3.0.0: signal-exit "^3.0.2" typedarray-to-buffer "^3.1.5" -ws@>=8.13.0: - version "8.13.0" - resolved "https://registry.yarnpkg.com/ws/-/ws-8.13.0.tgz#9a9fb92f93cf41512a0735c8f4dd09b8a1211cd0" - integrity sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA== +ws@>=8.14.2: + version "8.14.2" + resolved "https://registry.yarnpkg.com/ws/-/ws-8.14.2.tgz#6c249a806eb2db7a20d26d51e7709eab7b2e6c7f" + integrity sha512-wEBG1ftX4jcglPxgFCMJmZ2PLtSbJ2Peg6TmpJFTbe9GZYOQCDPdMYu/Tm0/bGZkw8paZnJY45J4K2PZrLYq8g== xdg-basedir@^4.0.0: version "4.0.0" @@ -3010,14 +2668,6 @@ yargs@16.2.0: y18n "^5.0.5" yargs-parser "^20.2.2" -yauzl@^2.10.0: - version "2.10.0" - resolved "https://registry.yarnpkg.com/yauzl/-/yauzl-2.10.0.tgz#c7eb17c93e112cb1086fa6d8e51fb0667b79a5f9" - integrity sha512-p4a9I6X6nu6IhoGmBqAcbJy1mlC4j27vEPZX9F4L4/vZT3Lyq1VkFHw/V/PUcB9Buo+DG3iHkT0x3Qya58zc3g== - dependencies: - buffer-crc32 "~0.2.3" - fd-slicer "~1.1.0" - yn@3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50" From 6308107cc088c1022940bc78efe4475acaaafa25 Mon Sep 17 00:00:00 2001 From: George Gevoian Date: Thu, 12 Oct 2023 01:01:03 -0400 Subject: [PATCH 15/16] Expose window test variables more explicitly --- calendar/page.js | 15 ++++++++++----- test/calendar.ts | 12 ++++++------ 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/calendar/page.js b/calendar/page.js index 4b0b6e75..0ca57f70 100644 --- a/calendar/page.js +++ b/calendar/page.js @@ -1,7 +1,7 @@ // to keep all calendar related logic; -var calendarHandler; +let calendarHandler; -var CALENDAR_NAME = 'standardCalendar'; +const CALENDAR_NAME = 'standardCalendar'; const t = i18next.t; @@ -9,8 +9,12 @@ const urlParams = new URLSearchParams(window.location.search); const isReadOnly = urlParams.get('readonly') === 'true' || (urlParams.has('access') && urlParams.get('access') !== 'full'); -// for tests -var dataVersion = Date.now(); +// Expose a few test variables on `window`. +window.gristCalendar = { + calendarHandler, + CALENDAR_NAME, + dataVersion: Date.now(), +}; function getLanguage() { if (this._lang) { @@ -417,6 +421,7 @@ class CalendarHandler { ready(async () => { await translatePage(); calendarHandler = new CalendarHandler(); + window.gristCalendar.calendarHandler = calendarHandler; await configureGristSettings(); }); @@ -716,7 +721,7 @@ async function updateCalendar(records, mappings) { calendarHandler.setEvents(new Map(events.map(event => ([event.id, event])))); updateUIAfterNavigation(); } - dataVersion = Date.now(); + window.gristCalendar.dataVersion = Date.now(); } function focusWidget() { diff --git a/test/calendar.ts b/test/calendar.ts index 2df39891..6325005f 100644 --- a/test/calendar.ts +++ b/test/calendar.ts @@ -17,8 +17,8 @@ describe('calendar', function () { async function getVisibleCalendarEvent(eventId: number): Promise { const eventJSON = await grist.executeScriptInCustomWidget((id: number) => { - const calendarName = (window as any).CALENDAR_NAME; - const calendarHandler = (window as any).calendarHandler; + const calendarName = (window as any).gristCalendar.CALENDAR_NAME; + const calendarHandler = (window as any).gristCalendar.calendarHandler; const event = calendarHandler.calendar.getEvent(id, calendarName); if (!event) { return null; } @@ -37,7 +37,7 @@ describe('calendar', function () { async function getCalendarEvent(eventId: number): Promise { const eventJSON = await grist.executeScriptInCustomWidget((id: number) => { - const event = (window as any).calendarHandler.getEvents().get(id); + const event = (window as any).gristCalendar.calendarHandler.getEvents().get(id); if (!event) { return null; } const eventData = { @@ -53,13 +53,13 @@ describe('calendar', function () { async function getCalendarViewName(): Promise { return grist.executeScriptInCustomWidget(() => { - return (window as any).calendarHandler.calendar.getViewName(); + return (window as any).gristCalendar.calendarHandler.calendar.getViewName(); }); } async function getDataVersion(): Promise { return grist.executeScriptInCustomWidget(() => { - return (window as any).dataVersion; + return (window as any).gristCalendar.dataVersion; }); } @@ -166,7 +166,7 @@ describe('calendar', function () { const today = new Date(); const validateDate = async (daysToAdd: number) => { const newDate = await grist.executeScriptInCustomWidget(() => { - return (window as any).calendarHandler.calendar.getDate().d.toDate().toDateString(); + return (window as any).gristCalendar.calendarHandler.calendar.getDate().d.toDate().toDateString(); }); const expectedDate = new Date(today); From 18747139cff2de9fced83b4b868cb615ef859b30 Mon Sep 17 00:00:00 2001 From: George Gevoian Date: Thu, 12 Oct 2023 11:56:51 -0400 Subject: [PATCH 16/16] Remove unused script --- package.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/package.json b/package.json index 72010e0b..ca922762 100644 --- a/package.json +++ b/package.json @@ -11,8 +11,7 @@ "dev": "echo 'Starting local server and watching for changes.\nStart Grist with an environmental variable GRIST_WIDGET_LIST_URL=http://localhost:8585/manifest.json' && npm run watch 1> /dev/null & npm run serve:dev 1> /dev/null", "test": "docker image inspect gristlabs/grist --format 'gristlabs/grist image present' && NODE_PATH=_build SELENIUM_BROWSER=chrome mocha -g \"${GREP_TESTS}\" _build/test/*.js", "test:ci": "MOCHA_WEBDRIVER_HEADLESS=1 npm run test", - "pretest": "docker pull gristlabs/grist && tsc --build && node ./buildtools/publish.js http://localhost:9998", - "grist": "docker run -t -i --rm --name grist-dev --add-host=host.docker.internal:host-gateway -e PORT=8484 -e GRIST_SINGLE_ORG=preview -e GRIST_WIDGET_LIST_URL=http://host.docker.internal:8585/manifest.json gristlabs/grist" + "pretest": "docker pull gristlabs/grist && tsc --build && node ./buildtools/publish.js http://localhost:9998" }, "devDependencies": { "@types/chai": "^4.3.5",