From aa71e6ffbc5717a3bbd1c42c79f11bb8c67cf88e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Omar=20Gerardo=20Soto-Fortu=C3=B1o?= Date: Tue, 21 Sep 2021 08:46:58 -0400 Subject: [PATCH] Fix length issue ViolationTray.test.js test plan: - Run `yarn jest ./ui/features/account_settings/react/components/__tests__/ViolationTray.test.js` - Notice a clean test log. - Remove the mockResponse. - Run it again and notice length error. qa risk: low Change-Id: I30bb20bf870efb6ed19dbc7ee01ce8edf8ac79c9 Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/273974 Reviewed-by: Davis Hyer QA-Review: Davis Hyer Product-Review: Davis Hyer Tested-by: Service Cloud Jenkins --- .../react/components/__tests__/ViolationTray.test.js | 1 + 1 file changed, 1 insertion(+) diff --git a/ui/features/account_settings/react/components/__tests__/ViolationTray.test.js b/ui/features/account_settings/react/components/__tests__/ViolationTray.test.js index 6975f3db063d..a7657473417d 100644 --- a/ui/features/account_settings/react/components/__tests__/ViolationTray.test.js +++ b/ui/features/account_settings/react/components/__tests__/ViolationTray.test.js @@ -32,6 +32,7 @@ describe('Violation Tray', () => { }) it('displays a spinner when loading data', async () => { + fetch.mockResponse(JSON.stringify([])) const {findByText} = render() // Even though there isn't an expect here... it's functionally the same, // if it doesn't find it... the test will fail :)