From 6e05e404a608374c9afcf1d49dc95420942d355a Mon Sep 17 00:00:00 2001 From: ihor-romaniuk Date: Tue, 9 Jan 2024 16:54:21 +0100 Subject: [PATCH] fix: [AXIMST-221] after review --- src/course-unit/CourseUnit.test.jsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/course-unit/CourseUnit.test.jsx b/src/course-unit/CourseUnit.test.jsx index d3b9127d8c..3dd1b1e03a 100644 --- a/src/course-unit/CourseUnit.test.jsx +++ b/src/course-unit/CourseUnit.test.jsx @@ -89,18 +89,21 @@ describe('', () => { const { open } = window; window.open = jest.fn(); const { getByRole } = render(); - const { draft_preview_link, published_preview_link } = courseSectionVerticalMock; + const { + draft_preview_link: draftPreviewLink, + published_preview_link: publishedPreviewLink, + } = courseSectionVerticalMock; await waitFor(() => { const viewLiveButton = getByRole('button', { name: headerNavigationsMessages.viewLiveButton.defaultMessage }); userEvent.click(viewLiveButton); expect(window.open).toHaveBeenCalled(); - expect(window.open).toHaveBeenCalledWith(published_preview_link, '_blank'); + expect(window.open).toHaveBeenCalledWith(publishedPreviewLink, '_blank'); const previewButton = getByRole('button', { name: headerNavigationsMessages.previewButton.defaultMessage }); userEvent.click(previewButton); expect(window.open).toHaveBeenCalled(); - expect(window.open).toHaveBeenCalledWith(draft_preview_link, '_blank'); + expect(window.open).toHaveBeenCalledWith(draftPreviewLink, '_blank'); }); window.open = open;