Skip to content

Commit

Permalink
Add e2e test for testing $lookup on pre-populated codings that lack d…
Browse files Browse the repository at this point in the history
…isplays
  • Loading branch information
fongsean committed Jun 14, 2024
1 parent 063564d commit 6b24e48
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions apps/smart-forms-app/e2e/prepop.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,4 +151,16 @@ test('pre-pop to test terminology resolving logic', async ({ page }) => {
.getByTestId('q-item-choice-select-answer-value-set-box')
.locator(`#${genderAvsContainedValueLinkId}`)
).toHaveValue('Female');

const medicalHistoryConditionValueLinkId = 'medical-history-condition';

const elements = await page.locator(`#${medicalHistoryConditionValueLinkId}`).all();
for (const element of elements) {
const inputValue = await element.inputValue();

// Test if the input values contains at least one alphabetic character
// If it's fully numeric, it means the valueCoding.code is pre-populated instead of valueCoding.display
// the logic in sdc-populate, automatically $lookup and assigns display to codings that lack them, which means that part is failing in this case
expect(/^\d+$/.test(inputValue)).toBeFalsy();
}
});

0 comments on commit 6b24e48

Please sign in to comment.