import React from 'react';
import { screen } from '@testing-library/react';
import { renderInAppContext } from '@theorchard/suite-testing';
import SelectPage from '..';

describe('SelectPage', () => {
    test('page text renders', async () => {
        renderInAppContext(<SelectPage />);
        expect(
            await screen.findByText(
                $t('bundles.selectPage.selectBundleTypeTitle')
            )
        ).toBeInTheDocument();
        expect(
            await screen.findByText(
                $t('bundles.selectPage.selectBundleTypeSubtitle')
            )
        ).toBeInTheDocument();
    });

    test('dropdown menu renders', async () => {
        renderInAppContext(<SelectPage />);
        expect(
            await screen.findByText(
                $t('bundles.selectPage.selectBundleDropdownPlaceholder')
            )
        ).toBeInTheDocument();
    });

    test('next button disabled on page load', () => {
        renderInAppContext(<SelectPage />);
        expect(
            screen
                .getByText($t('bundles.selectPage.nextButtonLabel'))
                .closest('button')
        ).toBeDisabled();
    });
});
