export async function waitForAttribute()

in packages/app/src/setupTests.tsx [30:36]


export async function waitForAttribute(text: RegExp, attribute: string, expected: string, count = 0) {
  if (count > 10) throw Error(`${attribute} never equals ${expected}`);
  const element = await screen.findByText(text);
  if (element.getAttribute(attribute) === expected) return true;
  await wait(10);
  await waitForAttribute(text, attribute, expected, count + 1);
}