Just want to make sure I am doing this idiomatically and the samples I've seen don't appear to show this... When I click a button, I want to check to see an aria attribute has been updated. To get the test to work, I need to re-query for that element. Is that the best way, or should I be awaiting on something?
test("should set aria-selected on tab after click", () => {
let secondTab = getAllByRole("tab")[1];
fireEvent.click(secondTab);
secondTab = getAllByRole("tab")[1]; // Is this proper?
expect(secondTab).toHaveAttribute("aria-selected", "true");