This commit is contained in:
2025-07-14 17:26:57 +00:00
parent 95e92a5533
commit 193b1f5234
6 changed files with 409 additions and 10 deletions

View File

@@ -76,4 +76,34 @@ tap.test('render image lightbox component', async () => {
document.body.removeChild(lightbox);
});
tap.test('render dropdown menu component', async () => {
// Create and add dropdown menu
const dropdown = new socialioCatalog.SioDropdownMenu();
dropdown.items = [
{ id: 'option1', label: 'Option 1', icon: 'settings' },
{ id: 'option2', label: 'Option 2', icon: 'user' },
{ id: 'divider', label: '', divider: true },
{ id: 'delete', label: 'Delete', icon: 'trash', destructive: true }
];
document.body.appendChild(dropdown);
await dropdown.updateComplete;
expect(dropdown).toBeInstanceOf(socialioCatalog.SioDropdownMenu);
// Check main elements
const trigger = dropdown.shadowRoot.querySelector('.trigger');
expect(trigger).toBeTruthy();
const dropdownElement = dropdown.shadowRoot.querySelector('.dropdown');
expect(dropdownElement).toBeTruthy();
// Check menu items
const menuItems = dropdown.shadowRoot.querySelectorAll('.menu-item');
expect(menuItems.length).toEqual(3); // 3 items (excluding divider)
console.log('Dropdown menu component rendered successfully');
document.body.removeChild(dropdown);
});
tap.start();