From 2fe32b89177e2a03ea635f236f456f7c5ab5b10f Mon Sep 17 00:00:00 2001 From: Stefan Topfstedt Date: Mon, 24 Jun 2024 14:43:21 -0700 Subject: [PATCH] start fleshing out page objects for dashboard calendar components. --- .../components/dashboard/calendar-filters.js | 9 +++++ .../components/dashboard/calendar.js | 37 ++++++++++++++++++- .../components/dashboard/filter-tags.js | 9 +++++ 3 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 packages/ilios-common/addon-test-support/ilios-common/page-objects/components/dashboard/calendar-filters.js create mode 100644 packages/ilios-common/addon-test-support/ilios-common/page-objects/components/dashboard/filter-tags.js diff --git a/packages/ilios-common/addon-test-support/ilios-common/page-objects/components/dashboard/calendar-filters.js b/packages/ilios-common/addon-test-support/ilios-common/page-objects/components/dashboard/calendar-filters.js new file mode 100644 index 0000000000..c041c35e7d --- /dev/null +++ b/packages/ilios-common/addon-test-support/ilios-common/page-objects/components/dashboard/calendar-filters.js @@ -0,0 +1,9 @@ +import { create } from 'ember-cli-page-object'; + +const definition = { + scope: '[data-test-dashboard-calendar-filters]', + // @todo implement [ST 2024/06/24] +}; + +export default definition; +export const component = create(definition); diff --git a/packages/ilios-common/addon-test-support/ilios-common/page-objects/components/dashboard/calendar.js b/packages/ilios-common/addon-test-support/ilios-common/page-objects/components/dashboard/calendar.js index 4669ef895f..958cca8770 100644 --- a/packages/ilios-common/addon-test-support/ilios-common/page-objects/components/dashboard/calendar.js +++ b/packages/ilios-common/addon-test-support/ilios-common/page-objects/components/dashboard/calendar.js @@ -1,11 +1,46 @@ -import { create } from 'ember-cli-page-object'; +import { collection, create, fillable, property } from 'ember-cli-page-object'; import weeklyCalendar from './../weekly-calendar'; import dailyCalendar from './../daily-calendar'; import weekGlance from './../week-glance'; import monthlyCalendar from './../monthly-calendar'; +import toggle from '../toggle-buttons'; +import userContextFilter from './user-context-filter'; +import calendarFilters from './calendar-filters'; +import filterTags from './filter-tags'; const definition = { scope: '[data-test-dashboard-calendar]', + controls: { + scope: '[data-test-dashboard-calendar-controls]', + mySchedule: { + scope: '[data-test-myschedule]', + toggle, + }, + showFilters: { + scope: '[data-test-showfilters]', + toggle, + }, + showCourseFilters: { + scope: '[data-test-showcoursefilters]', + toggle, + }, + userContexts: { + scope: '[data-test-usercontexts]', + toggle: userContextFilter, + }, + schoolPicker: { + scope: '[data-test-schoolpicker]', + select: { + scope: '[data-test-select-school]', + set: fillable(), + options: collection('option', { + isSelected: property('selected'), + }), + }, + }, + calendarFilters, + }, + filterTags, dailyCalendar, weekGlance, weeklyCalendar, diff --git a/packages/ilios-common/addon-test-support/ilios-common/page-objects/components/dashboard/filter-tags.js b/packages/ilios-common/addon-test-support/ilios-common/page-objects/components/dashboard/filter-tags.js new file mode 100644 index 0000000000..31dae4f2f2 --- /dev/null +++ b/packages/ilios-common/addon-test-support/ilios-common/page-objects/components/dashboard/filter-tags.js @@ -0,0 +1,9 @@ +import { create } from 'ember-cli-page-object'; + +const definition = { + scope: '[data-test-dashboard-filter-tags]', + // @todo implement [ST 2024/06/24] +}; + +export default definition; +export const component = create(definition);