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
4 changes: 2 additions & 2 deletions src/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -1099,8 +1099,8 @@
"route": "/flows",
"type": "index",
"title": "Flows",
"config": { "entitySource": "flows", "app": "stackiq" },
"_note": "ADR-110 Decision 4: a flow is app-specific, so the authoring surface lives here rather than behind a deep link to another app's list. An ordinary index over the named `flows` source (config.entitySource) rather than the deprecated `flows` page type, reading OpenRegister's one native flow store (ADR-065), scoped to this app by config.app."
"config": { "entitySource": "flows", "app": "stackiq", "rowRoute": "FlowDetail" },
"_note": "ADR-110 Decision 4: a flow is app-specific, so the authoring surface lives here rather than behind a deep link to another app's list. An ordinary index over the named `flows` source (config.entitySource) rather than the deprecated `flows` page type, reading OpenRegister's one native flow store (ADR-065), scoped to this app by config.app. rowRoute names the FlowDetail page (a route name, not a path): a named-source page has no register and schema, so without it a row click opens nothing and Edit falls back to the source's own /flows path."
},
{
"id": "FlowDetail",
Expand Down
43 changes: 43 additions & 0 deletions tests/vitest/flowPages.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/**
* SPDX-FileCopyrightText: 2026 Conduction B.V.
* SPDX-License-Identifier: EUPL-1.2
*
* The flow pages use the canonical form: an index over the `flows` source whose
* rows open a page of type `flow`, on the addresses links already point at.
*
* @spec exclude Structural invariant of the shipped manifest; no behavioural spec.
*/
import * as fs from 'fs'
import * as path from 'path'
import { describe, expect, it } from 'vitest'
import { createMemoryHistory, createRouter } from 'vue-router'

const { pages } = JSON.parse(fs.readFileSync(path.resolve(__dirname, '../../src/manifest.json'), 'utf8'))
const byId = new Map(pages.map((page) => [page.id, page]))
const router = createRouter({
history: createMemoryHistory(),
routes: pages.map((page) => ({ name: page.id, path: page.route, component: {} })),
})

describe('flow pages', () => {
it('names no deprecated flow page type', () => {
expect(pages.filter((page) => ['flows', 'flow-detail'].includes(page.type)).map((page) => page.id)).toEqual([])
})

it('Flows is an index over the flows source, scoped to this app', () => {
const { type, config } = byId.get('Flows')
expect(type).toBe('index')
expect(config.entitySource).toBe('flows')
expect(config.app).toBe('stackiq')
})

it('Flows opens its rows on a flow page', () => {
expect(byId.get(byId.get('Flows').config.rowRoute).type).toBe('flow')
})

it('keeps the flow addresses on the flow pages', () => {
expect(router.resolve('/flows').name).toBe('Flows')
expect(router.resolve('/flows/new').name).toBe('FlowDetail')
expect(router.resolve('/flows/abc').name).toBe('FlowDetail')
})
})
Loading