mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-27 12:53:13 +03:00
Fixed failure to render gh-members-import-table compontent
refs 4ee30dc5bd
- The tests were failing because there was no protective code to check for empty parameters.
This commit is contained in:
parent
5d261bfde8
commit
2da05338dd
@ -24,19 +24,11 @@ export default class GhMembersImportTable extends Component {
|
||||
}
|
||||
|
||||
get hasNextRecord() {
|
||||
const nextValue = this.dataPreviewIndex + 1;
|
||||
if (this.args.importData[nextValue]) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return this.args.importData && !!(this.args.importData[this.dataPreviewIndex + 1]);
|
||||
}
|
||||
|
||||
get hasPrevRecord() {
|
||||
const nextValue = this.dataPreviewIndex - 1;
|
||||
if (this.args.importData[nextValue]) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return this.args.importData && !!(this.args.importData[this.dataPreviewIndex - 1]);
|
||||
}
|
||||
|
||||
get currentRecord() {
|
||||
@ -44,7 +36,11 @@ export default class GhMembersImportTable extends Component {
|
||||
}
|
||||
|
||||
get allRecords() {
|
||||
return this.args.importData.length;
|
||||
if (this.args.importData) {
|
||||
return this.args.importData.length;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@action
|
||||
|
@ -21,7 +21,7 @@ describe('Integration: Component: gh-members-import-table', function () {
|
||||
expect(find('table')).to.exist;
|
||||
expect(findAll('table thead th').length).to.equal(3);
|
||||
expect(findAll('table tbody tr').length).to.equal(1);
|
||||
expect(find('table tbody tr').textContent).to.match(/No data/);
|
||||
expect(find('table tbody').textContent).to.match(/No data/);
|
||||
});
|
||||
|
||||
it('renders members data with all the properties', async function () {
|
||||
|
Loading…
Reference in New Issue
Block a user