Skip to content

Commit

Permalink
STDTC-100 Formatting a list of jobs without the progress field result…
Browse files Browse the repository at this point in the history
…s in an error on the UI (#280)
  • Loading branch information
NikitaSedyx authored Dec 13, 2023
1 parent 88bb67c commit 1adca1a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## IN PROGRESS

* Add onfilter function to ViewAllLogsFilter. Refs STDTC-99.
* Formatting a list of jobs without the "progress" field results in an error on the UI. Refs STDTC-100.

## [6.0.0](https://github.com/folio-org/stripes-data-transfer-components/tree/v6.0.0) (2023-10-12)
[Full Changelog](https://github.com/folio-org/stripes-data-transfer-components/compare/v5.4.1...v6.0.0)
Expand Down
2 changes: 1 addition & 1 deletion lib/ListTemplate/listTemplate.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ export const listTemplate = ({
);
},
jobProfileName: record => record.jobProfileInfo?.name,
totalRecords: record => formatNumber(record.progress.total),
totalRecords: record => formatNumber(record.progress?.total || 0),
fileName: record => record.fileName,
hrId: record => record.hrId,
});
6 changes: 6 additions & 0 deletions lib/ListTemplate/listTemplate.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,12 @@ describe('List template', () => {

expect(getByText('0')).toBeDefined();
});

it('then appropriate text should be rendered when progress is not defined', () => {
const { getByText } = renderWithIntl(templates.totalRecords({ ...testRecord, progress: undefined }));

expect(getByText('0')).toBeDefined();
});
});

describe('when column is `fileName`', () => {
Expand Down

0 comments on commit 1adca1a

Please sign in to comment.