import { test, expect } from '@playwright/test'

test('[Input]type', async ({ page }) => {
  page.on('pageerror', (exception) => expect(exception).toBeNull())
  await page.goto('input#type')
  const input = page.locator('.demo-input > .tiny-input >  .tiny-input-display-only > input')
  const textArea = page.locator('.demo-input > .tiny-textarea > .tiny-textarea-display-only > textarea')
  await expect(input.nth(0)).toHaveAttribute('type', 'text')
  await expect(input.nth(1)).toHaveAttribute('type', 'password')
  await expect(input.nth(2)).toHaveAttribute('type', 'email')
  await expect(input.nth(3)).toHaveAttribute('type', 'number')
  await expect(input.nth(4)).toHaveAttribute('type', 'tel')
  await expect(input.nth(5)).toHaveAttribute('type', 'url')
  await expect(input.nth(6)).toHaveAttribute('type', 'hidden')
  await expect(input.nth(7)).toHaveAttribute('type', 'color')
  await expect(input.nth(8)).toHaveAttribute('type', 'date')
  await expect(input.nth(9)).toHaveAttribute('type', 'month')
  await expect(input.nth(10)).toHaveAttribute('type', 'week')
  await expect(input.nth(11)).toHaveAttribute('type', 'datetime-local')
  await expect(input.nth(12)).toHaveAttribute('type', 'time')
  await expect(input.nth(13)).toHaveAttribute('type', 'file')
  await expect(input.nth(14)).toHaveAttribute('type', 'range')
  await expect(textArea).toBeVisible()
})
