update
This commit is contained in:
@@ -46,4 +46,34 @@ tap.test('render fab component', async () => {
|
||||
document.body.removeChild(fab);
|
||||
});
|
||||
|
||||
tap.test('render image lightbox component', async () => {
|
||||
// Create and add lightbox
|
||||
const lightbox = new socialioCatalog.SioImageLightbox();
|
||||
document.body.appendChild(lightbox);
|
||||
|
||||
await lightbox.updateComplete;
|
||||
expect(lightbox).toBeInstanceOf(socialioCatalog.SioImageLightbox);
|
||||
|
||||
// Check main elements
|
||||
const overlay = lightbox.shadowRoot.querySelector('.overlay');
|
||||
expect(overlay).toBeTruthy();
|
||||
|
||||
const container = lightbox.shadowRoot.querySelector('.container');
|
||||
expect(container).toBeTruthy();
|
||||
|
||||
// Test opening with an image
|
||||
await lightbox.open({
|
||||
url: 'https://picsum.photos/800/600',
|
||||
name: 'Test Image',
|
||||
size: 123456
|
||||
});
|
||||
|
||||
await lightbox.updateComplete;
|
||||
expect(lightbox.isOpen).toEqual(true);
|
||||
|
||||
console.log('Image lightbox component rendered successfully');
|
||||
|
||||
document.body.removeChild(lightbox);
|
||||
});
|
||||
|
||||
tap.start();
|
||||
Reference in New Issue
Block a user