ElectronicBabylonianLiterature/ebl-frontend

View on GitHub
src/test-support/lemmatization.ts

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
import { screen } from '@testing-library/react'
import { clickNth, changeValueByLabel } from './utils'
import Lemma from 'transliteration/domain/Lemma'

export async function lemmatizeWord(word: string, lemma: Lemma): Promise<void> {
  await screen.findByText(word)
  clickNth(screen, word, 0)
  await screen.findByLabelText('Lemma')
  changeValueByLabel(screen, 'Lemma', 'a')
  await screen.findByText(lemma.lemma)
  clickNth(screen, lemma.lemma, 0)
}