Skip to content

Commit ed42a4a

Browse files
authored
fix(hub): align tests, example & API snapshots with dropped ~builtin category default (#95)
1 parent 6d1bb4f commit ed42a4a

5 files changed

Lines changed: 8 additions & 8 deletions

File tree

examples/minimal-next-devframe-hub/src/client/devframe/minimal-next-devframe-hub.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,13 +205,14 @@ export async function minimalNextDevframeHub(
205205
})
206206

207207
// The hub no longer synthesizes built-in docks — a high-level integration
208-
// registers the viewer's native views it wants. `~builtin` views default
209-
// their category to `~builtin`, so this Settings tab sorts last on its own.
208+
// registers the viewer's native views it wants, declaring the `~builtin`
209+
// category itself so this Settings tab groups and sorts last.
210210
context.docks.register({
211211
type: '~builtin',
212212
id: '~settings',
213213
title: 'Settings',
214214
icon: 'ph:gear-duotone',
215+
category: '~builtin',
215216
})
216217

217218
// Demo devframes alongside the dogfooded built-in plugin packages.

examples/minimal-next-devframe-hub/tests/minimal-next-devframe-hub.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ describe('minimal-next-devframe-hub (example)', () => {
3535
const dockIds = docks.map(d => d.id)
3636
expect(dockIds).toContain('next-demo-tool')
3737
// The hub synthesizes no built-in docks; the integration registers the
38-
// settings tab itself, and `~builtin` views default to the `~builtin` category.
38+
// settings tab itself, declaring the `~builtin` category explicitly.
3939
expect(dockIds).toContain('~settings')
4040
expect(docks.find(d => d.id === '~settings')?.category).toBe('~builtin')
4141
// The dogfooded built-in plugin packages mount their own docks.

packages/hub/src/node/__tests__/host-docks.test.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,13 +190,13 @@ describe('devframeDockHost grouping', () => {
190190
})
191191
})
192192

193-
describe('devframeDockHost ~builtin category default', () => {
193+
describe('devframeDockHost ~builtin category', () => {
194194
it('returns no docks until an integration registers one', () => {
195195
const host = new DevframeDocksHost(createContext())
196196
expect(host.values()).toEqual([])
197197
})
198198

199-
it('defaults a ~builtin view without a category to the ~builtin category', () => {
199+
it('preserves a ~builtin view without a category untouched', () => {
200200
const host = new DevframeDocksHost(createContext())
201201
host.register({
202202
type: '~builtin',
@@ -206,7 +206,8 @@ describe('devframeDockHost ~builtin category default', () => {
206206
})
207207

208208
const entry = host.values()[0]
209-
expect(entry).toMatchObject({ id: '~settings', type: '~builtin', category: '~builtin' })
209+
expect(entry).toMatchObject({ id: '~settings', type: '~builtin' })
210+
expect(entry.category).toBeUndefined()
210211
})
211212

212213
it('preserves an explicit category on a ~builtin view', () => {

tests/__snapshots__/tsnapi/@devframes/hub/node.snapshot.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ export declare class DevframeDocksHost implements DevframeDocksHost$1 {
3636
update: (_: Partial<T>) => void;
3737
};
3838
update(_: DevframeDockUserEntry): void;
39-
private withBuiltinCategory;
4039
private validateGroupMembership;
4140
private prepareRemoteRegistration;
4241
}

tests/__snapshots__/tsnapi/@devframes/hub/node.snapshot.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ export class DevframeDocksHost {
2727
resolveDevServerOrigin() {}
2828
register(_, _) {}
2929
update(_) {}
30-
withBuiltinCategory(_) {}
3130
validateGroupMembership(_) {}
3231
prepareRemoteRegistration(_) {}
3332
}

0 commit comments

Comments
 (0)