Skip to content

Commit

Permalink
fix: selector in handler browser tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mjturt committed Oct 2, 2023
1 parent 102fecb commit bbf0a6e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@ test('Fill in new application', async (t: TestController) => {

await t.navigateTo('/new-application');

await t
.typeText('[class*="CompanySearch___"]', '0201256-6')
.pressKey('enter');
const searchCompanyInput = Selector(
'[data-testid="company-search-input"]'
).find('input');
await t.typeText(searchCompanyInput, '0201256-6').pressKey('enter');

await t.typeText('#companyBankAccountNumber', 'FI81 4975 4587 0004 02');
await t.typeText('#companyContactPersonFirstName', 'Kuura');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const CompanySearch: React.FC = () => {
<div>
<h2>{t('common:applications.sections.companySearch.heading')}</h2>
<$GridCell as={$Grid} $colSpan={12}>
<$GridCell $colSpan={6}>
<$GridCell $colSpan={6} data-testid="company-search-input">
<SearchInput
label={t(
`${translationsBase}.companySearch.searchCompanyDetails`
Expand All @@ -57,7 +57,7 @@ const CompanySearch: React.FC = () => {
<SelectionGroup
label={t(`${translationsBase}.companySearch.select`)}
>
{companies.map(({name, business_id: businessId}) => (
{companies.map(({ name, business_id: businessId }) => (
<RadioButton
key={businessId}
id={`v-radio-${businessId}`}
Expand Down

0 comments on commit bbf0a6e

Please sign in to comment.