From fdb10f6c29a0b58fd080359d05d5ff0b238a7d7a Mon Sep 17 00:00:00 2001 From: Emily Plummer Date: Tue, 2 Mar 2021 14:33:15 -0800 Subject: [PATCH] fix test so this doesn't happen again :) --- src/__tests__/TabNav.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/__tests__/TabNav.tsx b/src/__tests__/TabNav.tsx index bb0dec20851..216919beec4 100644 --- a/src/__tests__/TabNav.tsx +++ b/src/__tests__/TabNav.tsx @@ -1,6 +1,6 @@ import React from 'react' import {TabNav} from '..' -import {mount, render, rendersClass, behavesAsComponent, checkExports} from '../utils/testing' +import {render, behavesAsComponent, checkExports} from '../utils/testing' import {COMMON} from '../constants' import {render as HTMLRender, cleanup} from '@testing-library/react' import {axe, toHaveNoViolations} from 'jest-axe' @@ -19,13 +19,15 @@ describe('TabNav', () => { }) it('should have no axe violations', async () => { - const {container} = HTMLRender() + const {container} = HTMLRender() const results = await axe(container) expect(results).toHaveNoViolations() cleanup() }) it('sets aria-label appropriately', () => { - expect(render().props['aria-label']).toEqual('foo') + const {getByLabelText} = HTMLRender() + expect(getByLabelText("stuff")).toBeTruthy(); + expect(getByLabelText("stuff").tagName).toEqual("NAV") }) })