chore: formatting

This commit is contained in:
saberzero1
2026-07-30 15:43:15 +02:00
parent 507ad7f3d4
commit 7076a897e1
2 changed files with 15 additions and 18 deletions
+13 -8
View File
@@ -36,7 +36,10 @@ describe("position assignment", () => {
const component = makeComponent("MyPlugin") const component = makeComponent("MyPlugin")
componentRegistry.register("my-plugin", component, "test-source") componentRegistry.register("my-plugin", component, "test-source")
const result = buildLayoutForEntries([makeEntry("my-plugin", { position: "left", priority: 10 })], {}) const result = buildLayoutForEntries(
[makeEntry("my-plugin", { position: "left", priority: 10 })],
{},
)
assert.deepStrictEqual(result.left, [component]) assert.deepStrictEqual(result.left, [component])
}) })
@@ -102,10 +105,7 @@ describe("defaultPosition fallback", () => {
defaultPosition: "right", defaultPosition: "right",
}) })
const result = buildLayoutForEntries( const result = buildLayoutForEntries([makeEntry("p", { position: "left", priority: 10 })], {})
[makeEntry("p", { position: "left", priority: 10 })],
{},
)
assert.deepStrictEqual(result.left, [component]) assert.deepStrictEqual(result.left, [component])
assert.deepStrictEqual(result.right, []) assert.deepStrictEqual(result.right, [])
}) })
@@ -290,11 +290,16 @@ describe("buildLayoutForEntries with constructors", () => {
componentRegistry.setOptionOverrides("merge-plugin", { extra: true }) componentRegistry.setOptionOverrides("merge-plugin", { extra: true })
const result = buildLayoutForEntries( const result = buildLayoutForEntries(
[{ source: "merge-plugin", enabled: true, options: { base: 1 }, layout: { position: "right" as LayoutPosition, priority: 10 } }], [
{
source: "merge-plugin",
enabled: true,
options: { base: 1 },
layout: { position: "right" as LayoutPosition, priority: 10 },
},
],
{}, {},
) )
assert.strictEqual(result.right?.length, 1) assert.strictEqual(result.right?.length, 1)
}) })
}) })
+2 -10
View File
@@ -74,11 +74,7 @@ describe("resolveLayout", () => {
}) })
test("preserves component references through override", () => { test("preserves component references through override", () => {
const result = resolveLayout( const result = resolveLayout(makePageType(), { head: StubHead, footer: [StubA, StubB] }, {})
makePageType(),
{ head: StubHead, footer: [StubA, StubB] },
{},
)
assert.strictEqual(result.footer[0], StubA) assert.strictEqual(result.footer[0], StubA)
assert.strictEqual(result.footer[1], StubB) assert.strictEqual(result.footer[1], StubB)
}) })
@@ -105,11 +101,7 @@ describe("resolveLayout frame resolution", () => {
}) })
test("defaults to 'default' when byPageType entry exists but has no frame", () => { test("defaults to 'default' when byPageType entry exists but has no frame", () => {
const result = resolveLayout( const result = resolveLayout(makePageType(), { head: StubHead }, { content: { left: [StubA] } })
makePageType(),
{ head: StubHead },
{ content: { left: [StubA] } },
)
assert.strictEqual(result.frame, "default") assert.strictEqual(result.frame, "default")
}) })
}) })