import { newSpecPage } from '@stencil/core/testing';
import { BsIconGradientWrapper } from '../bs-icon-gradient-wrapper';
import { MockMutationObserver } from '../../../utils/test/mocks';
import { faker } from '@faker-js/faker';
describe('bs-icon-gradient-wrapper', () => {
  global.MutationObserver = MockMutationObserver;
  it('renders', async () => {
    // Need to control the UUID to check it later
    const uuid = faker.random.alphaNumeric(20);
    class BsIconGradientWrapperTest extends BsIconGradientWrapper {
      get uniqueId() {
        return uuid;
      }
    }
    const page = await newSpecPage({
      components: [BsIconGradientWrapperTest],
      html: `<bs-icon-gradient-wrapper><bs-icon-discussions /></bs-icon-gradient-wrapper>`,
    });
    expect(page.root).toEqualHtml(`
      <bs-icon-gradient-wrapper>
        <span
          class="svg-wrapper"
          data-slot
          style="fill: url(#${uuid})"
        >
          <bs-icon-discussions></bs-icon-discussions>
        </span>
        <svg
          height="0"
          viewBox="0 0 0 0"
          width="0"
          xmlns="http://www.w3.org/2000/svg"
        >
          <linearGradient
            gradientUnits="userSpaceOnUse"
            id="${uuid}"
            x1="0"
            x2="100%"
            y1="0"
            y2="100%"
          >
            <stop offset="0.1326" stop-color="#EE282A"></stop>
            <stop offset="0.5466" stop-color="#1C0087"></stop>
            <stop offset="0.9715" stop-color="#0086EA"></stop>
          </linearGradient>
        </svg>
      </bs-icon-gradient-wrapper>
    `);
  });
});
//# sourceMappingURL=bs-icon-gradient-wrapper.spec.js.map
