Skip to content

Commit

Permalink
Fix LazyMobXTable countHeader when only has 1 page (#4911)
Browse files Browse the repository at this point in the history
* Fix LazyMobXTable countHeader when only has 1 page

---------

Co-authored-by: lismana <[email protected]>
Co-authored-by: alisman <[email protected]>
  • Loading branch information
3 people authored May 24, 2024
1 parent d1b6cd5 commit 20cf5ad
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 9 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -908,7 +908,7 @@ describe('group comparison mutations tab tests', function() {

assert.equal(
getElementByTestHandle('LazyMobXTable_CountHeader').getText(),
'14 Mutations (page 1 of 1)'
'14 Mutations'
);

assert.equal(
Expand All @@ -921,7 +921,7 @@ describe('group comparison mutations tab tests', function() {

assert.equal(
getElementByTestHandle('LazyMobXTable_CountHeader').getText(),
'1 Mutation (page 1 of 1)'
'1 Mutation'
);

assert.equal(
Expand All @@ -934,7 +934,7 @@ describe('group comparison mutations tab tests', function() {

assert.equal(
getElementByTestHandle('LazyMobXTable_CountHeader').getText(),
'16 Mutations (page 1 of 1)'
'16 Mutations'
);

assert.equal(
Expand Down
4 changes: 2 additions & 2 deletions end-to-end-test/remote/specs/core/screenshot.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -270,10 +270,10 @@ describe('patient view page screenshot test', function() {
goToUrlAndSetLocalStorage(url);

// should show 0 mutations
$('.//*[text()[contains(.,"0 Mutations")]]').waitForExist();
$('span*=0 Mutations').waitForExist();

// should show 21.6% copy number altered in genomic overview
$('.//*[text()[contains(.,"21.6%")]]').waitForExist();
$('div*=21.6%').waitForExist();

// take screenshot
var res = browser.checkElement('#mainColumn', '', { hide: ['.qtip'] });
Expand Down
12 changes: 8 additions & 4 deletions src/shared/components/lazyMobXTable/LazyMobXTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1162,8 +1162,10 @@ export default class LazyMobXTable<T> extends React.Component<
fontWeight: 'bold',
}}
>
{this.store.displayData.length} {this.store.itemsLabel} (page{' '}
{this.store.page + 1} of {this.store.maxPage + 1})
{this.store.displayData.length} {this.store.itemsLabel}
{this.store.maxPage + 1 > 1 &&
` (page ${this.store.page + 1} of ${this.store.maxPage +
1})`}
</h3>
) : (
<span
Expand All @@ -1175,8 +1177,10 @@ export default class LazyMobXTable<T> extends React.Component<
fontWeight: 'bold',
}}
>
{this.store.displayData.length} {this.store.itemsLabel} (page{' '}
{this.store.page + 1} of {this.store.maxPage + 1})
{this.store.displayData.length} {this.store.itemsLabel}
{this.store.maxPage + 1 > 1 &&
` (page ${this.store.page + 1} of ${this.store.maxPage +
1})`}
</span>
);
}
Expand Down

0 comments on commit 20cf5ad

Please sign in to comment.