[Extension API] Register about panel badge (#1436)

* Custom about panel badge

* Add playwright test

* Update README

* nit

* nit

* nit

* nit
This commit is contained in:
Chenlei Hu
2024-11-05 19:06:38 -05:00
committed by GitHub
parent c56533bb23
commit c560628f1f
6 changed files with 112 additions and 31 deletions

View File

@@ -134,4 +134,27 @@ test.describe('Topbar commands', () => {
expect(await comfyPage.page.evaluate(() => window['changeCount'])).toBe(2)
})
})
test.describe('About panel', () => {
test('Should allow adding badges', async ({ comfyPage }) => {
await comfyPage.page.evaluate(() => {
window['app'].registerExtension({
name: 'TestExtension1',
aboutPageBadges: [
{
label: 'Test Badge',
url: 'https://example.com',
icon: 'pi pi-box'
}
]
})
})
await comfyPage.settingDialog.open()
await comfyPage.settingDialog.goToAboutPanel()
const badge = comfyPage.page.locator('.about-badge').last()
expect(badge).toBeDefined()
expect(await badge.textContent()).toContain('Test Badge')
})
})
})