Skip to content

Commit

Permalink
fixed bug in maxTagPlaceholder and value filter plugin tests
Browse files Browse the repository at this point in the history
  • Loading branch information
GITHUB_USERNAME authored and GITHUB_USERNAME committed Jan 17, 2023
1 parent 6b9b428 commit 0d66466
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -404,9 +404,9 @@ describe('Horizontal FilterBar', () => {
saveNativeFilterSettings([SAMPLE_CHART]);
cy.getBySel('filter-bar').within(() => {
cy.get(nativeFilters.filterItem).contains('Albania').should('be.visible');
cy.get(nativeFilters.filterItem).contains('+1').should('be.visible');
cy.get(nativeFilters.filterItem).contains('+ 1 ...').should('be.visible');
cy.get('.ant-select-selection-search-input').click();
cy.get(nativeFilters.filterItem).contains('+2').should('be.visible');
cy.get(nativeFilters.filterItem).contains('+ 2 ...').should('be.visible');
});
});
});
Expand Down
5 changes: 3 additions & 2 deletions superset-frontend/src/components/Select/Select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -409,9 +409,10 @@ const Select = forwardRef(

const customMaxTagPlaceholder = () => {
const num_selected = ensureIsArray(selectValue).length;
const num_shown = maxTagCount as number;
return selectAllMode
? `+ ${num_selected - 1} ...`
: `+ ${num_selected} ...`;
? `+ ${num_selected - num_shown - 1} ...`
: `+ ${num_selected - num_shown} ...`;
};

return (
Expand Down

0 comments on commit 0d66466

Please sign in to comment.