Fix wrong default data structure in 'getReportTableData' (https://github.com/woocommerce/woocommerce-admin/pull/1042)
* Fix wrong default data structure in 'getReportTableData' * Update tests * Change default prop for tableData from null to an empty object in ReportTable
This commit is contained in:
parent
4cd01a3b3b
commit
bb3e66ef32
|
@ -118,7 +118,7 @@ ReportTable.propTypes = {
|
|||
};
|
||||
|
||||
ReportTable.defaultProps = {
|
||||
tableData: null,
|
||||
tableData: {},
|
||||
tableQuery: {},
|
||||
};
|
||||
|
||||
|
|
|
@ -451,7 +451,9 @@ describe( 'getReportTableData()', () => {
|
|||
const response = {
|
||||
isError: false,
|
||||
isRequesting: false,
|
||||
items: [],
|
||||
items: {
|
||||
data: [],
|
||||
},
|
||||
};
|
||||
|
||||
const query = {
|
||||
|
|
|
@ -305,7 +305,9 @@ export function getReportTableData( endpoint, urlQuery, select, query = {} ) {
|
|||
query: tableQuery,
|
||||
isRequesting: false,
|
||||
isError: false,
|
||||
items: [],
|
||||
items: {
|
||||
data: [],
|
||||
},
|
||||
};
|
||||
|
||||
const items = getReportItems( endpoint, tableQuery );
|
||||
|
|
Loading…
Reference in New Issue