chore: formatting
This commit is contained in:
@@ -36,7 +36,10 @@ describe("position assignment", () => {
|
||||
const component = makeComponent("MyPlugin")
|
||||
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])
|
||||
})
|
||||
|
||||
@@ -102,10 +105,7 @@ describe("defaultPosition fallback", () => {
|
||||
defaultPosition: "right",
|
||||
})
|
||||
|
||||
const result = buildLayoutForEntries(
|
||||
[makeEntry("p", { position: "left", priority: 10 })],
|
||||
{},
|
||||
)
|
||||
const result = buildLayoutForEntries([makeEntry("p", { position: "left", priority: 10 })], {})
|
||||
assert.deepStrictEqual(result.left, [component])
|
||||
assert.deepStrictEqual(result.right, [])
|
||||
})
|
||||
@@ -290,11 +290,16 @@ describe("buildLayoutForEntries with constructors", () => {
|
||||
componentRegistry.setOptionOverrides("merge-plugin", { extra: true })
|
||||
|
||||
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)
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
|
||||
@@ -74,11 +74,7 @@ describe("resolveLayout", () => {
|
||||
})
|
||||
|
||||
test("preserves component references through override", () => {
|
||||
const result = resolveLayout(
|
||||
makePageType(),
|
||||
{ head: StubHead, footer: [StubA, StubB] },
|
||||
{},
|
||||
)
|
||||
const result = resolveLayout(makePageType(), { head: StubHead, footer: [StubA, StubB] }, {})
|
||||
assert.strictEqual(result.footer[0], StubA)
|
||||
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", () => {
|
||||
const result = resolveLayout(
|
||||
makePageType(),
|
||||
{ head: StubHead },
|
||||
{ content: { left: [StubA] } },
|
||||
)
|
||||
const result = resolveLayout(makePageType(), { head: StubHead }, { content: { left: [StubA] } })
|
||||
assert.strictEqual(result.frame, "default")
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user