feat(scheduling): compose request editor from core UI
This commit is contained in:
@@ -11,6 +11,8 @@ assert.match(page, /usePlatformUiCapability<CalendarPickerUiCapability>\("calend
|
||||
assert.match(page, /hasScope\(auth, "calendar:calendar:read"\)/);
|
||||
assert.match(page, /Boolean\(calendarPickerCapability\) && canReadCalendars && canReadAvailability && canWriteCalendarEvent/);
|
||||
assert.doesNotMatch(page, /@govoplan\/calendar-webui|govoplan-calendar\/webui/);
|
||||
assert.match(page, /Card,[\s\S]*DataGrid,[\s\S]*DataGridEmptyAction,[\s\S]*DataGridRowActions,[\s\S]*ModuleSubnav,[\s\S]*ToggleSwitch,[\s\S]*from "@govoplan\/core-webui"/);
|
||||
assert.doesNotMatch(page, /@govoplan\/core-webui\/src\//);
|
||||
assert.match(page, /className="scheduling-full-editor"/);
|
||||
assert.match(page, /className="scheduling-page-actions"/);
|
||||
|
||||
@@ -19,10 +21,35 @@ const editorActions = page.slice(
|
||||
page.indexOf('</div>', page.indexOf('<div className="scheduling-page-actions">'))
|
||||
);
|
||||
assert.ok(editorActions.indexOf("I18N.discard") < editorActions.indexOf("I18N.save"));
|
||||
assert.match(page, /<Plus aria-hidden="true" size=\{16\} \/> \{I18N\.addRequest\}/);
|
||||
assert.match(editorActions, /form="scheduling-create-form"/);
|
||||
|
||||
const createBranchStart = page.indexOf(" if (creating) {");
|
||||
const createReturnStart = page.indexOf("\n return (", createBranchStart);
|
||||
const browseBranchStart = page.indexOf("\n return (", createReturnStart + 1);
|
||||
const createBranch = page.slice(createBranchStart, browseBranchStart);
|
||||
const browseBranch = page.slice(browseBranchStart);
|
||||
assert.match(createBranch, /<ModuleSubnav/);
|
||||
assert.match(createBranch, /className="scheduling-create-subnav"/);
|
||||
assert.doesNotMatch(browseBranch, /scheduling-sidebar|<aside/);
|
||||
|
||||
assert.match(browseBranch, /<h1>\{I18N\.requests\}<\/h1>/);
|
||||
assert.match(browseBranch, /<Plus aria-hidden="true" size=\{16\} \/> \{I18N\.add\}/);
|
||||
assert.match(page, /title=\{I18N\.myRequests\}/);
|
||||
assert.match(page, /title=\{I18N\.invitedRequests\}/);
|
||||
assert.match(page, /className="scheduling-table-actions"/);
|
||||
assert.match(createBranch, /<Card title=\{I18N\.basicInformation\}>/);
|
||||
assert.match(createBranch, /<Card title=\{I18N\.calendarIntegration\}>/);
|
||||
assert.match(page, /<Card title=\{I18N\.candidateSlots\}>/);
|
||||
assert.match(page, /<Card title=\{I18N\.participants\}>/);
|
||||
assert.match(createBranch, /<ToggleSwitch[\s\S]*checked=\{calendarEnabled\}/);
|
||||
assert.match(page, /id="scheduling-create-candidate-slots-grid"/);
|
||||
assert.match(page, /id="scheduling-create-participants-grid"/);
|
||||
assert.match(page, /id="scheduling-candidate-slots-grid"/);
|
||||
assert.match(page, /id="scheduling-participants-grid"/);
|
||||
assert.match(page, /<DataGridRowActions/);
|
||||
assert.match(page, /<DataGridEmptyAction/);
|
||||
assert.doesNotMatch(page, /EmailAddressInput|MailboxAddress|addressSuggestions|addressLookupQuery/);
|
||||
assert.match(page, /type="email"[\s\S]*aria-label=\{I18N\.participantEmail\}/);
|
||||
assert.doesNotMatch(page, /header: I18N\.required|<table|scheduling-table|scheduling-card(?:\s|"|`)/);
|
||||
assert.match(page, /aria-label=\{i18nMessage\("i18n:govoplan-scheduling\.decide_on_value/);
|
||||
assert.match(page, /submitSchedulingAvailability\(settings, selected\.id/);
|
||||
assert.doesNotMatch(page, /<p>\{selected\.calendar_id\}<\/p>/);
|
||||
|
||||
Reference in New Issue
Block a user