---
title: Tests for add-calendar-view skill
last_updated: 2026-04-27
---

# Tests — add-calendar-view

Each test is an activation scenario followed by a verification checklist that confirms the
skill executed correctly. Run these in order after shipping the skill.

---

## Test 1: Skill Activation — Intent Phrases

**Input prompts to try (each should activate this skill, not a different one):**

-   "add a calendar for Visit"
-   "planning view for Tour appointments"
-   "weekly view of Call events"
-   "schedule view for Order deliveries"
-   "agenda screen for Visits"
-   "drag-to-reschedule calendar for calls"

**Verify:**

-   [ ] Each phrase activates `add-calendar-view`, not `add-list-screen` or `add-detail-screen`
-   [ ] Skill presents the 6-question input prompt before proceeding

**Anti-activation phrases (these should NOT trigger this skill):**

-   "flat list of this week's visits" → `add-list-screen`
-   "detail page for a single visit" → `add-detail-screen`
-   "cockpit card showing today's visit count" → `add-cockpit-card`

---

## Test 2: Weekly View — Minimal Flow (No Drag, No Settings)

**Setup:**

```
Entity: Visit
Module: Visit
Default view: week
Drag-and-drop: no
Sidebar: no
User settings: no
```

**Execution checks:**

-   [ ] `verify-sqlite-schema` invoked for Visit columns (Id, start/end date/time, status, Name)
-   [ ] DS created: `DsLoVisitCalendar_sf.datasource.xml` with ConditionalParameters for `dateFrom`/`dateTo`
-   [ ] LO created: all six required LI property groups present
        (`plannedStartDate`, `plannedEndDate`, `plannedStartTime`, `plannedEndTime`, `allDay`, `Color`)
-   [ ] UI created: CalendarControl with correct attributes; child order `Bindings → Settings → Items → Events`
-   [ ] `<Settings />` present (empty) even though no user-settings LO
-   [ ] No `CalendarItemMoveEvent` in the UI (drag disabled)
-   [ ] Process EntryActions initializes `currentWeeklyViewStartDate` via `Utils.createAnsiDateToday`
-   [ ] Process handles `DateRangeChanged` event: captures dates → re-LOADs LO → transitions to VIEW
-   [ ] Navigation entry wired (cockpit or parent)
-   [ ] `build-and-simulate` invoked; build passes
-   [ ] Events appear in the correct week slots in the simulator
-   [ ] Navigating to the next week reloads events for the new range

---

## Test 3: Drag-and-Drop Flow

**Setup:**

```
Entity: Visit
Module: Visit
Default view: week
Drag-and-drop: yes
Sidebar: no
User settings: no
```

**Additional checks over Test 2:**

-   [ ] `CalendarItemMoveEvent` present in the UI with params: `pKey`, `plannedStartDate`,
        `plannedEndDate`, `plannedStartTime`, `plannedEndTime`
-   [ ] Process VIEW action for weekly view has `<Event name="itemMove" action="RescheduleVisitSilently" />`
-   [ ] `RescheduleVisitSilently` (or equivalent) is a PROCESS action calling a reschedule sub-process
        with `Silent=1` as a Literal parameter
-   [ ] After drag, reschedule sub-process is invoked with updated dates/times
-   [ ] Post-reschedule, the process re-LOADs the LO and returns to the calendar VIEW
-   [ ] In simulator: drag an event to a new slot — change persists on page reload

**Failure mode check:**

-   [ ] If `itemMove` event is in the UI but no matching event in the process → identify this
        as Fm2 and show the fix (add `<Event name="itemMove" ...>` to the VIEW's Events block)

---

## Test 4: User Settings Persistence

**Setup:**

```
Entity: Visit
Module: Visit
Default view: week (from user settings, not hardcoded)
Drag-and-drop: no
Sidebar: no
User settings: yes
```

**Additional checks over Test 2:**

-   [ ] Process Declarations include `userSettings` of type `LoUserSetting`
-   [ ] EntryActions include `AssignUserSettings` LOGIC action calling
        `ApplicationContext::User.getCallCalendarSettings`
-   [ ] CalendarControl `<Settings>` bound to `ProcessContext::userSettings` (not `<Settings />`)
-   [ ] Process DECISION routes to the correct initial view based on `ClbCalendarInitialViewMobility`
        from user settings
-   [ ] In simulator: change the default view in user settings — calendar opens in the new view

**Failure mode check:**

-   [ ] If `<Settings />` is used instead of `<Settings dataSource="...">` when settings are
        enabled → identify as Fm3 (wrong default view); show the fix

---

## Test 5: DS Range-Filter Performance Contract

This test verifies the critical performance invariant without running a full flow.

**Setup:** Inspect the DS file created by Step 2 for any entity.

**Verify:**

-   [ ] DS file contains a `<ConditionalParameters>` block
-   [ ] Block includes at minimum one parameter for start-of-range and one for end-of-range
-   [ ] The parameters map to the entity's start and end date/time columns respectively
-   [ ] The process action `GetEntityByDateRange` (or equivalent) passes these parameters
        when calling the LOAD action

**Failure mode check (simulate Fm4):**

-   [ ] Remove the ConditionalParameters from the DS and re-run the build → build still passes
-   [ ] Load the calendar in the simulator with a large dataset → verify performance degrades
-   [ ] Re-add the range filter → confirm fix; confirm build still passes
-   [ ] Document that Fm4 is a **runtime** failure, not a build-time failure

---

## Test 6: MFG Absence Audit

**Command:**

```bash
grep -rni "mfg\|MfgVisit\|MfgQuality\|MfgAgreements" \
  .claude/skills/add-calendar-view/ \
  --include="*.md" \
  | grep -v "MFG check\|Forbidden\|no-MFG\|NO MFG" \
  || echo "NO MFG — PASS"
```

**Verify:**

-   [ ] Output is `NO MFG — PASS`
-   [ ] No MFG module names appear in any example entity, module path, or file name in the skill files
-   [ ] All example modules use Visit, Call, Tour, or other non-MFG modules

---

## Regression Checks (Run After Any Skill Edit)

-   [ ] `find .claude/skills/add-calendar-view -type f | sort` shows exactly 4 files
-   [ ] `SKILL.md` has frontmatter with `name: add-calendar-view`
-   [ ] `SKILL.md` line count is between 280 and 380 lines
-   [ ] Foundation skill references in `SKILL.md` ≥ 5:
        `grep -c "verify-sqlite-schema\|create-datasource\|create-list-object\|create-ui-page\|create-process\|create-business-logic\|build-and-simulate" SKILL.md`
-   [ ] `references/calendar-control.md` line count is between 120 and 180 lines
-   [ ] `references/user-settings.md` line count is between 60 and 100 lines
-   [ ] Real file anchors in `SKILL.md` and `references/calendar-control.md` resolve on disk:
    -   `src/Visit/PR/Visit_Calendar/Visit_CalendarWeeklyViewUI.userinterface.xml`
    -   `src/Visit/PR/Visit_Calendar/Visit_CalendarProcess.processflow.xml`
    -   `src/User/BO/BoUser/Mv1/BoUser.GetCallCalendarSettings.bl.js`
