// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-nocheck
import React from 'react'
import renderer from 'react-test-renderer'
import Expander, { ExpanderProps } from '../index'

describe('Expander Snapshot', () => {
  describe('component rendered on server', () => {
    it('default render', () => {
      const props: ExpanderProps = {
        id: 'test-id',
      }
      const tree = renderer
        .create(
          <Expander {...props}>
            <div>Children 1</div>
            <div>Children 2</div>
          </Expander>
        )
        .toJSON()
      expect(tree).toMatchSnapshot()
    })

    it('only on mobile', () => {
      const props: ExpanderProps = {
        id: 'test-id',
        onlyMobile: true,
      }
      const tree = renderer
        .create(
          <Expander {...props}>
            <div>Children 1</div>
            <div>Children 2</div>
          </Expander>
        )
        .toJSON()
      expect(tree).toMatchSnapshot()
    })

    it('with different labels', () => {
      const props: ExpanderProps = {
        id: 'test-id',
        collapseLabel: 'Close',
        expandLabel: 'Open',
      }
      const tree = renderer
        .create(
          <Expander {...props}>
            <div>Children 1</div>
            <div>Children 2</div>
          </Expander>
        )
        .toJSON()
      expect(tree).toMatchSnapshot()
    })

    it('with different state', () => {
      const props: ExpanderProps = {
        id: 'test-id',
        state: 'expanded',
      }
      const tree = renderer
        .create(
          <Expander {...props}>
            <div>Children 1</div>
            <div>Children 2</div>
          </Expander>
        )
        .toJSON()
      expect(tree).toMatchSnapshot()
    })
  })
})
