update
This commit is contained in:
@@ -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();
|
||||
Reference in New Issue
Block a user