Skip to content

Commit

Permalink
Changed the unique key for lists
Browse files Browse the repository at this point in the history
  • Loading branch information
doracretu3pillar committed Oct 2, 2024
1 parent 7b2adc0 commit f280f83
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ describe('PerconaUpdateVersion', () => {
{
version: 'PMM 3.0.1',
tag: 'string',
timestamp: '2024-09-24T09:12:31.488Z',
timestamp: '2024-09-23T09:12:31.488Z',
release_notes_url: 'http://localhost:3000',
release_notes_text: 'text1',
},
Expand All @@ -44,18 +44,6 @@ describe('PerconaUpdateVersion', () => {
updateAvailable: true,
latest: { version: '3.0.1' },
lastChecked: '',
changeLogs: {
lastCheck: '',
updates: [
{
version: 'PMM 3.0.1',
tag: 'string',
timestamp: '2024-09-24T09:12:31.488Z',
releaseNotesUrl: 'http://localhost:3000',
releaseNotesText: 'text1',
},
],
},
},
};
jest.spyOn(UpdatesService, 'getUpdatesChangelogs').mockReturnValue(Promise.resolve({ ...changeLogsAPIResponse }));
Expand Down Expand Up @@ -84,14 +72,14 @@ describe('PerconaUpdateVersion', () => {
{
version: 'PMM 3.0.1',
tag: 'string',
timestamp: '2024-09-24T09:12:31.488Z',
timestamp: '2024-09-27T09:12:31.488Z',
release_notes_url: 'http://localhost:3000',
release_notes_text: 'text1',
},
{
version: 'PMM 3.0.2',
tag: 'string',
timestamp: '2024-09-24T09:12:31.488Z',
timestamp: '2024-09-23T09:12:31.488Z',
release_notes_url: 'http://localhost:3000',
release_notes_text: 'text2',
},
Expand All @@ -103,25 +91,6 @@ describe('PerconaUpdateVersion', () => {
updateAvailable: true,
latest: { version: '3.0.1' },
lastChecked: '',
changeLogs: {
lastCheck: '',
updates: [
{
version: 'PMM 3.0.1',
tag: 'string',
timestamp: '2024-09-24T09:12:31.488Z',
releaseNotesUrl: 'http://localhost:3000',
releaseNotesText: 'text1',
},
{
version: 'PMM 3.0.2',
tag: 'string',
timestamp: '2024-09-24T09:12:31.488Z',
releaseNotesUrl: 'http://localhost:3000',
releaseNotesText: 'text2',
},
],
},
},
};
jest.spyOn(UpdatesService, 'getUpdatesChangelogs').mockReturnValue(Promise.resolve({ ...changeLogsAPIResponse }));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ const PerconaUpdateVersion: FC = () => {
<h5 className={styles.newVersionsTitle}>{Messages.newVersions}</h5>
<ul className={styles.listOfReleaseNotes}>
{changeLogs?.updates.map((update: UpdatesChangeLogs) => (
<li key={update.toString()}>
<li key={update.timestamp}>
<a target="_blank" rel="noopener noreferrer" href={update.releaseNotesUrl}>
{update.version}, {dateTimeFormat(update.timestamp, { format: 'MMM DD, YYYY' })}
</a>
Expand Down

0 comments on commit f280f83

Please sign in to comment.