ipal-doctor: old-style block maps, 2FA behind a switch, folder name as database base; first sweep table
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
a4e8cfeae8
commit
e97cf6d7d9
@@ -149,6 +149,19 @@ describe('layout, blocks, seeds, agents', () => {
|
||||
const report = await doctor(lib, ['blocks-ui-required', 'blocks-ui-override', 'blocks-registry'])
|
||||
expect(report.findings.map((f) => f.message)).toEqual(["components/ui/ overrides Button but the registry does not pass them — library blocks keep the plugin's look"])
|
||||
})
|
||||
test('an old-style blockType → component map passes blocks-registry; 2FA behind a switch is a warning', async () => {
|
||||
const map = project({ ...base(), 'src/blocks/registry.ts': "export const blockRegistry: BlockComponentMap = { hero: Hero }" })
|
||||
expect((await doctor(map, ['blocks-registry'])).findings).toEqual([])
|
||||
const sw = project({ ...base(), ...installed('@clocklimited/payload-2fa', '3.0.0'), 'src/payload.config.ts': "twoFactor: process.env.X === 'true' ? false : { issuer: 'A', plugin: payloadTotp }," })
|
||||
expect(rules(await doctor(sw, ['2fa']))).toEqual(['2fa:warning'])
|
||||
})
|
||||
test('the folder name gives the database base when there is no domain', async () => {
|
||||
const parent = project({})
|
||||
const root = path.join(parent, 'acmepl-web')
|
||||
mkdirSync(root)
|
||||
writeFileSync(path.join(root, '.env'), 'DATABASE_URI=mongodb://db/acme\n')
|
||||
expect((await doctor(root, ['db-name'])).findings.map((f) => f.message)).toEqual(['.env: database "acme", expected acmepl_dev'])
|
||||
})
|
||||
test('a project block duplicating a library block (also by a renamed slug) and helper copies', async () => {
|
||||
const root = project({
|
||||
...base(),
|
||||
|
||||
Reference in New Issue
Block a user