// eslint-disable-next-line @typescript-eslint/triple-slash-reference
/// <reference path="../../../../test/src/custom_typings/chai.d.ts" />
/* eslint-disable no-undef */
import { ZuiTextareaElement } from '@zywave/zui-textarea';
import { assert } from '@esm-bundle/chai';
import { randSentence } from '../../../../test/src/util/helpers';
import { faceTests } from '../../../../test/src/util/face-tests';

suite('zui-textarea', () => {
  let element: ZuiTextareaElement;

  setup(() => {
    element = document.createElement('zui-textarea') as ZuiTextareaElement;

    document.body.appendChild(element);
  });

  teardown(() => {
    document.body.removeChild(element);
  });

  test('initializes as a ZuiTextarea', () => {
    assert.instanceOf(element, ZuiTextareaElement);
  });

  faceTests<ZuiTextareaElement>('zui-textarea', {
    suiteName: 'zui-textarea',
    value: randSentence(25),
    defaultValue: '',
    valueAccessor(element) {
      return element.value;
    },
  });
});
