import { newSpecPage } from '@stencil/core/testing';
import { BsHint } from '../bs-hint';
import { faker } from '@faker-js/faker';
const hint = faker.random.words();
describe('bs-hint', () => {
  it('renders hint text', async () => {
    const page = await newSpecPage({
      components: [BsHint],
      html: `<bs-hint hints="${hint}"></bs-hint>`,
    });
    expect(page.root).toEqualText(hint);
  });
  it('handles error prop by applying error styles', async () => {
    const page = await newSpecPage({
      components: [BsHint],
      html: `<bs-hint hints="${hint}" error="true"></bs-hint>`,
    });
    const component = page.root;
    expect(component.firstElementChild).toHaveAttribute('data-error');
    component.error = false;
    await page.waitForChanges();
    expect(component.firstElementChild).not.toHaveAttribute('data-error');
  });
  it('renders an array of hints', async () => {
    const hints = Array(faker.random.words().split(' '));
    const page = await newSpecPage({
      components: [BsHint],
      html: `<bs-hint hints="${hints}" error="true"></bs-hint>`,
    });
    expect(page.root).toEqualText(hints.join(','));
  });
});
//# sourceMappingURL=bs-hint.spec.js.map
