Skip to content

Commit

Permalink
preserve push-out behavior when possible (#139619)
Browse files Browse the repository at this point in the history
  • Loading branch information
flash1293 authored Aug 29, 2022
1 parent f1c0985 commit b5faac8
Show file tree
Hide file tree
Showing 3 changed files with 291 additions and 9 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,27 @@ describe('DatatableComponent', () => {
).toMatchSnapshot();
});

test('it renders custom row height if set to another value than 1', () => {
const { data, args } = sampleArgs();

expect(
shallow(
<DatatableComponent
data={data}
args={{ ...args, rowHeightLines: 5 }}
formatFactory={(x) => x as unknown as IFieldFormat}
dispatchEvent={onDispatchEvent}
getType={jest.fn()}
paletteService={chartPluginMock.createPaletteRegistry()}
uiSettings={{ get: jest.fn() } as unknown as IUiSettingsClient}
renderMode="edit"
interactive
renderComplete={renderComplete}
/>
)
).toMatchSnapshot();
});

test('it should render hide, reset, and sort actions on header even when it is in read only mode', () => {
const { data, args } = sampleArgs();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ export const DatatableComponent = (props: DatatableRenderProps) => {
rowHeightsOptions={{
defaultHeight: props.args.fitRowToContent
? 'auto'
: props.args.rowHeightLines
: props.args.rowHeightLines && props.args.rowHeightLines !== 1
? {
lineCount: props.args.rowHeightLines,
}
Expand Down

0 comments on commit b5faac8

Please sign in to comment.