Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@ import {
buildManifest,
CnPageRenderer,
defaultPageTypes,
installIntegrationRegistry,
registerBuiltinDashboardWidgets,
registerBuiltinIntegrations,
registerIcons,
registerLeafIntegrations,
registerTranslations,
} from '@conduction/nextcloud-vue'
import { loadState } from '@nextcloud/initial-state'
Expand Down Expand Up @@ -60,6 +63,28 @@ import './assets/app.css'
// the app-local copy did not have (`form: null`).
registerBuiltinDashboardWidgets()

// Integration registry (ADR-019). learniq's manifest declares THREE
// `type: "integration"` widgets — `cohort-talk` ("Class space") on
// CohortDetail, `session-talk` ("Join call") and `sess-files` ("Session
// materials") on SessionDetail — and nothing ever registered a provider for
// them to resolve against.
//
// That failure is silent by design. CnDetailPage.resolveIntegrationWidget()
// returns null when the integration is not registered, and its own docblock
// says what happens next: "the grid section simply renders nothing extra". No
// error, no placeholder, no gap in the layout — three declared widgets just
// were not there, on every page load since they were declared.
//
// Note this is NOT the "Talk is not installed" path. A registered talk leaf
// whose backing app is absent renders CnTalkCard's degraded surface, title and
// all; an UNREGISTERED one renders nothing whatsoever. talk-classroom-spaces
// e2e asserted the former and got the latter, and read as a Talk problem.
//
// Same three calls, same order, as decidiq's main.js.
installIntegrationRegistry()
registerBuiltinIntegrations()
registerLeafIntegrations()

// Register library-side icon set + lib translations once at bootstrap.
registerIcons(appIcons)
try {
Expand Down
6 changes: 5 additions & 1 deletion tests/e2e/spec-coverage/adaptive-release.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,12 @@ import { test, expect } from '../fixtures'
// `/index.php/apps/openregister/...` works. The failure surfaces as a selector
// or empty-result assertion, never as a visible 404. 29 of this suite's 34 spec
// files already used the `/index.php/` form.
// `_limit`, NOT `limit` — an unrecognised OpenRegister query parameter is
// applied as a PROPERTY FILTER rather than ignored, so `?limit=200` returns
// HTTP 200 with an empty result set and the guards below read it as "no Lesson
// seeded". This spec ran 0 of its 3 tests on every green run.
const LESSON_LIST_API =
'/index.php/apps/openregister/api/objects/learniq/Lesson?limit=200'
'/index.php/apps/openregister/api/objects/learniq/Lesson?_limit=200'

/**
* Fetch every Lesson and return the first one matching the given predicate,
Expand Down
51 changes: 43 additions & 8 deletions tests/e2e/spec-coverage/course-authoring-ux.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,22 @@ import { test, expect } from '../fixtures'
// `/index.php/` prefix is load-bearing on CI — a bare `php -S` does not rewrite
// pretty URLs, and `server/apps/openregister/` exists without an index.php, so
// the short form returns a hard 404. See adaptive-release.spec.ts.
// `_limit`, NOT `limit`. OpenRegister control parameters carry a leading
// underscore, and an UNRECOGNISED parameter is not ignored — it is applied as a
// PROPERTY FILTER. So `?limit=200` asks for Courses whose `limit` property
// equals 200, no object has one, and the endpoint answers HTTP 200 with a
// well-formed `{"results":[],"total":0}`.
//
// Measured live 2026-08-24 against a seeded instance:
// ?_limit=200 -> total=3
// ?limit=200 -> total=0
// ?bogusprop=xyz -> total=0 (same shape — it really is a filter)
//
// `resp.ok()` is therefore TRUE, the guard below reads an empty list, and the
// test skips as "No top-level Course seeded" — blaming the fixture for a typo
// in the query. This spec ran 0 of its 4 tests on every green CI run.
const COURSE_LIST_API =
'/index.php/apps/openregister/api/objects/learniq/Course?limit=200'
'/index.php/apps/openregister/api/objects/learniq/Course?_limit=200'

/**
* Fetch every Course and return the first top-level one (no parentCourseId),
Expand Down Expand Up @@ -79,8 +93,25 @@ async function openCourseBuilder(
courseId: string,
) {
await page.goto(`/index.php/apps/learniq/#/courses/${courseId}/builder`)
await page.waitForSelector('body', { timeout: 15_000 })
await page.waitForLoadState('domcontentloaded')

// Wait for the BUILDER, not for the document.
//
// This is a hash route in an SPA: `domcontentloaded` fires as soon as the
// shell parses, long before Vue has mounted the view or fetched the course.
// Waiting on `body` is weaker still — `body` exists immediately. The old
// helper did both and then the test read `innerText('body')` ONCE, with no
// retry, so it asserted against whatever had rendered by that instant:
// the app chrome and nothing else.
//
// `.course-builder__header` is the right anchor because CourseBuilder.vue
// renders exactly one of three branches — `loading`, `error`, or the
// content — and the header exists only in the third. Reaching it therefore
// proves the course resolved, which is what every assertion below assumes.
//
// It is also translation-independent: every string in this view goes
// through `t('learniq', ...)`, so a class is a stable anchor where the
// heading text is not.
await page.waitForSelector('.course-builder__header', { timeout: 20_000 })
}

test.describe('course-authoring-ux — CourseBuilder / LessonComposer / LessonPlayer', () => {
Expand All @@ -94,8 +125,9 @@ test.describe('course-authoring-ux — CourseBuilder / LessonComposer / LessonPl
const errors = collectFatalErrors(page)
await openCourseBuilder(page, course.id ?? course.uuid)

const bodyText = await page.innerText('body')
expect(bodyText).toContain('Course builder')
// Structural, not textual — see openCourseBuilder(). The heading itself
// is translated, so assert the surface that is not.
await expect(page.locator('.course-builder__header')).toBeVisible()

// Add two modules through the builder's own UI (no raw API POST).
const moduleNameInput = page.getByPlaceholder('New module name')
Expand Down Expand Up @@ -189,9 +221,12 @@ test.describe('course-authoring-ux — CourseBuilder / LessonComposer / LessonPl
await moduleRow.getByRole('button', { name: 'Add lesson' }).click()

await moduleRow.getByRole('button', { name: 'Compose' }).click()
await page.waitForSelector('body', { timeout: 15_000 })
await page.waitForLoadState('domcontentloaded')
await expect(page.getByText('Compose lesson')).toBeVisible()
// No page load here — Compose is an in-app view switch, so waiting on
// `body` / `domcontentloaded` measured nothing and only read as a wait.
// The retrying assertion below is what actually waits for the view.
await expect(page.getByText('Compose lesson')).toBeVisible({
timeout: 20_000,
})

// Add two richText blocks (no file-picker/NcSelect data dependency —
// drivable without seeded Material/Assessment fixtures).
Expand Down
5 changes: 4 additions & 1 deletion tests/e2e/spec-coverage/groepsplan.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,11 @@ const LEARNER_CONTEXT_URL =
// `/index.php/` prefix is load-bearing on CI — a bare `php -S` does not rewrite
// pretty URLs, and `server/apps/openregister/` exists without an index.php, so
// the short form returns a hard 404. See adaptive-release.spec.ts.
// `_limit`, NOT `limit` — an unrecognised OpenRegister query parameter is
// applied as a PROPERTY FILTER rather than ignored, so `?limit=200` returns
// HTTP 200 with an empty result set that reads as "nothing seeded".
const GROUP_PLAN_SUBGROUP_LIST_API =
'/index.php/apps/openregister/api/objects/learniq/GroupPlanSubgroup?limit=200'
'/index.php/apps/openregister/api/objects/learniq/GroupPlanSubgroup?_limit=200'

/**
* Collect console errors on a page, filtering out the same benign noise
Expand Down
6 changes: 5 additions & 1 deletion tests/e2e/spec-coverage/progress-tracking.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,12 @@ import { test, expect } from '../fixtures'
// `/index.php/` prefix is load-bearing on CI — a bare `php -S` does not rewrite
// pretty URLs, and `server/apps/openregister/` exists without an index.php, so
// the short form returns a hard 404. See adaptive-release.spec.ts.
// `_limit`, NOT `limit` — an unrecognised OpenRegister query parameter is
// applied as a PROPERTY FILTER rather than ignored, so `?limit=200` returns
// HTTP 200 with an empty result set and the guards below read it as "no
// published Lesson seeded". This spec ran 0 of its 2 tests on every green run.
const LESSON_LIST_API =
'/index.php/apps/openregister/api/objects/learniq/Lesson?limit=200'
'/index.php/apps/openregister/api/objects/learniq/Lesson?_limit=200'

/**
* Fetch every Lesson and return the first one matching the given predicate,
Expand Down
11 changes: 8 additions & 3 deletions tests/e2e/spec-coverage/report-card.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,17 @@ import { test, expect } from '../fixtures'
// `/index.php/` prefix is load-bearing on CI — a bare `php -S` does not rewrite
// pretty URLs, and `server/apps/openregister/` exists without an index.php, so
// the short form returns a hard 404. See adaptive-release.spec.ts.
// `_limit`, NOT `limit` — an unrecognised OpenRegister query parameter is
// applied as a PROPERTY FILTER rather than ignored, so `?limit=200` returns
// HTTP 200 with an empty result set that reads as "nothing seeded". These three
// already used the correct lowercase slugs; only the control parameter was
// wrong, which is precisely why it went unnoticed.
const REPORT_PERIOD_LIST_API =
'/index.php/apps/openregister/api/objects/learniq/report-period?limit=200'
'/index.php/apps/openregister/api/objects/learniq/report-period?_limit=200'
const REPORT_CARD_LIST_API =
'/index.php/apps/openregister/api/objects/learniq/report-card?limit=200'
'/index.php/apps/openregister/api/objects/learniq/report-card?_limit=200'
const GRADE_ENTRY_LIST_API =
'/index.php/apps/openregister/api/objects/learniq/grade-entry?limit=200'
'/index.php/apps/openregister/api/objects/learniq/grade-entry?_limit=200'

/**
* Fetch every row for a schema's index endpoint and return the first one
Expand Down
11 changes: 8 additions & 3 deletions tests/e2e/spec-coverage/talk-classroom-spaces.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,17 @@ import { test, expect } from '../fixtures'
// `/index.php/` prefix is load-bearing on CI — a bare `php -S` does not rewrite
// pretty URLs, and `server/apps/openregister/` exists without an index.php, so
// the short form returns a hard 404. See adaptive-release.spec.ts.
// `_limit`, NOT `limit` — an unrecognised OpenRegister query parameter is
// applied as a PROPERTY FILTER rather than ignored, so `?limit=200` returns
// HTTP 200 with an empty result set and the guards below read it as "nothing
// seeded". Measured: ?_limit=200 -> 3 cohorts/sessions/enrolments present,
// ?limit=200 -> 0. This spec ran 0 of its 3 tests on every green CI run.
const COHORT_LIST_API =
'/index.php/apps/openregister/api/objects/learniq/Cohort?limit=200'
'/index.php/apps/openregister/api/objects/learniq/Cohort?_limit=200'
const SESSION_LIST_API =
'/index.php/apps/openregister/api/objects/learniq/Session?limit=200'
'/index.php/apps/openregister/api/objects/learniq/Session?_limit=200'
const ENROLMENT_LIST_API =
'/index.php/apps/openregister/api/objects/learniq/Enrolment?limit=200'
'/index.php/apps/openregister/api/objects/learniq/Enrolment?_limit=200'

/**
* Fetch every row for a schema's index endpoint and return the first one
Expand Down
Loading