import { expect, fixture, html } from '@open-wc/testing';
import './nile-{{name}}';
import type { Nile{{pascalCase name}} } from './nile-{{name}}';

// One test per acceptance criterion in kb/specs/nile-{{name}}.md (nile-component skill).
describe('Nile{{pascalCase name}}', () => {
  it('renders', async () => {
    const el = await fixture<Nile{{pascalCase name}}>(html`<nile-{{name}}></nile-{{name}}>`);
    expect(el).to.exist;
    expect(el.shadowRoot).to.not.be.null;
  });

  it('exposes the base part', async () => {
    const el = await fixture<Nile{{pascalCase name}}>(html`<nile-{{name}}></nile-{{name}}>`);
    expect(el.shadowRoot!.querySelector('[part="base"]')).to.exist;
  });

  it('renders slotted content', async () => {
    const el = await fixture<Nile{{pascalCase name}}>(html`<nile-{{name}}><span>content</span></nile-{{name}}>`);
    expect(el.querySelector('span')).to.exist;
  });
});
