build(#10336): use toHaveTextContent

This commit is contained in:
Acid Chicken (硫酸鶏) 2023-03-31 16:36:43 +09:00
parent 558d73b21a
commit 85f50f3875
No known key found for this signature in database
GPG key ID: 3E87B98A3F6BAB99

View file

@ -44,10 +44,10 @@ const common = {
const back = buttons[args.__hasReduce ? 1 : 0]; const back = buttons[args.__hasReduce ? 1 : 0];
if (reduce) { if (reduce) {
await expect(reduce).toBeInTheDocument(); await expect(reduce).toBeInTheDocument();
await expect(reduce.textContent).toBe(i18n.ts._ad.reduceFrequencyOfThisAd); await expect(reduce).toHaveTextContent(i18n.ts._ad.reduceFrequencyOfThisAd);
} }
await expect(back).toBeInTheDocument(); await expect(back).toBeInTheDocument();
await expect(back.textContent).toBe(i18n.ts._ad.back); await expect(back).toHaveTextContent(i18n.ts._ad.back);
await userEvent.click(back); await userEvent.click(back);
if (reduce) { if (reduce) {
await expect(reduce).not.toBeInTheDocument(); await expect(reduce).not.toBeInTheDocument();