import { tap, expect, webhelpers } from '@git.zone/tstest/tapbundle';

import * as ecoCatalog from '../ts_web/index.js';

tap.test('should export EcoApplauncher component', async () => {
  expect(ecoCatalog.EcoApplauncher).toBeTypeOf('function');
});

tap.test('should export EcoScreensaver component', async () => {
  expect(ecoCatalog.EcoScreensaver).toBeTypeOf('function');
});

tap.test('should export applauncher sub-components', async () => {
  expect(ecoCatalog.EcoApplauncherWifimenu).toBeTypeOf('function');
  expect(ecoCatalog.EcoApplauncherBatterymenu).toBeTypeOf('function');
  expect(ecoCatalog.EcoApplauncherSoundmenu).toBeTypeOf('function');
  expect(ecoCatalog.EcoApplauncherKeyboard).toBeTypeOf('function');
  expect(ecoCatalog.EcoApplauncherPowermenu).toBeTypeOf('function');
});

tap.test('should create a working EcoApplauncher instance', async () => {
  const applauncher: ecoCatalog.EcoApplauncher = await webhelpers.fixture(
    webhelpers.html`<eco-applauncher></eco-applauncher>`
  );
  expect(applauncher).toBeInstanceOf(ecoCatalog.EcoApplauncher);
});

tap.test('should create a working EcoScreensaver instance', async () => {
  const screensaver: ecoCatalog.EcoScreensaver = await webhelpers.fixture(
    webhelpers.html`<eco-screensaver></eco-screensaver>`
  );
  expect(screensaver).toBeInstanceOf(ecoCatalog.EcoScreensaver);
});

export default tap.start();
