From c6179e39b3280ee9292a3cb7a6c9268850ff4e8c Mon Sep 17 00:00:00 2001 From: Xavier FACQ Date: Wed, 6 Nov 2024 12:36:53 +0100 Subject: [PATCH] [issue-3106] Display last release not when no version is provided (#3188) * [issue-3106] Display last release not when no version is provided * correct test * Fix release_name for tests * update snapshots * update snapshots 2 --- .../__tests__/ReleaseNotesRender.test.tsx | 2 + .../ReleaseNotesRender.test.tsx.snap | 841 +++++++++++++++++- src/components/ReleaseNotesRender/index.tsx | 7 +- src/hooks/fetchReleaseNotes.tsx | 18 +- .../__snapshots__/release-notes.test.tsx.snap | 2 +- 5 files changed, 850 insertions(+), 20 deletions(-) diff --git a/src/components/ReleaseNotesRender/__tests__/ReleaseNotesRender.test.tsx b/src/components/ReleaseNotesRender/__tests__/ReleaseNotesRender.test.tsx index 3e023b49b..a6ee6f9f3 100644 --- a/src/components/ReleaseNotesRender/__tests__/ReleaseNotesRender.test.tsx +++ b/src/components/ReleaseNotesRender/__tests__/ReleaseNotesRender.test.tsx @@ -73,6 +73,7 @@ describe('ReleaseNotesRender component', () => { function mockReleaseNotes(num: number) { let releaseNoteDataBag = { releaseNoteAPIResponse :createMockReleaseNotesAPI(num), isValid: true }; + releaseNoteDataBag.releaseNoteAPIResponse.release_name = 'jdk-20+36'; releaseNoteDataBag.releaseNoteAPIResponse.release_notes[0].type = 'Enhancement'; return releaseNoteDataBag; } @@ -92,6 +93,7 @@ describe('ReleaseNotesRender component', () => { queryString.parse = vi.fn().mockReturnValue({'version': 'version'}); function mockReleaseNotes() { let releaseNoteDataBag = { releaseNoteAPIResponse :createMockReleaseNotesAPI(1), isValid: true }; + releaseNoteDataBag.releaseNoteAPIResponse.release_name = 'version'; releaseNoteDataBag.releaseNoteAPIResponse.release_notes[0].priority = undefined; return releaseNoteDataBag; } diff --git a/src/components/ReleaseNotesRender/__tests__/__snapshots__/ReleaseNotesRender.test.tsx.snap b/src/components/ReleaseNotesRender/__tests__/__snapshots__/ReleaseNotesRender.test.tsx.snap index b5448a342..660599988 100644 --- a/src/components/ReleaseNotesRender/__tests__/__snapshots__/ReleaseNotesRender.test.tsx.snap +++ b/src/components/ReleaseNotesRender/__tests__/__snapshots__/ReleaseNotesRender.test.tsx.snap @@ -6,7 +6,7 @@ exports[`ReleaseNotesRender component > should render correctly - no release not class="text-center" >

- version + release_name_mock

should render correctly - version not de
-

+

+ release_name_mock +

should render correctly - version not de
-

- Oops... We couldn't find those release notes -

- - Please ensure that you have a specified a version using the version URL parameter: - - ?version=x.x.x - - +

+ This section organizes the changes in the selected update release by the main component under which each issue is filed. +

+

+ + The total number of fixes marked as P1 is: 2 + +

+
+
+ +
+
+