diff --git a/projects/components/src/table/cells/data-renderers/string-array/string-array-table-cell-renderer.component.scss b/projects/components/src/table/cells/data-renderers/string-array/string-array-table-cell-renderer.component.scss index 1d7308e9c..08c08d306 100644 --- a/projects/components/src/table/cells/data-renderers/string-array/string-array-table-cell-renderer.component.scss +++ b/projects/components/src/table/cells/data-renderers/string-array/string-array-table-cell-renderer.component.scss @@ -7,6 +7,7 @@ display: flex; flex-direction: row; align-items: center; + justify-content: space-between; &.first-column { @include body-1-medium($gray-9); diff --git a/projects/components/src/table/cells/data-renderers/string-array/string-array-table-cell-renderer.component.test.ts b/projects/components/src/table/cells/data-renderers/string-array/string-array-table-cell-renderer.component.test.ts index b7071769c..a0df0dd19 100644 --- a/projects/components/src/table/cells/data-renderers/string-array/string-array-table-cell-renderer.component.test.ts +++ b/projects/components/src/table/cells/data-renderers/string-array/string-array-table-cell-renderer.component.test.ts @@ -1,12 +1,14 @@ import { FormattingModule } from '@hypertrace/common'; -import { TableCellNoOpParser } from '@hypertrace/components'; +import { TableCellNoOpParser, XMoreComponent } from '@hypertrace/components'; import { createComponentFactory } from '@ngneat/spectator/jest'; +import { MockComponent } from 'ng-mocks'; import { tableCellDataProvider, tableCellProviders } from '../../test/cell-providers'; import { StringArrayTableCellRendererComponent } from './string-array-table-cell-renderer.component'; describe('String array table cell renderer component', () => { const buildComponent = createComponentFactory({ component: StringArrayTableCellRendererComponent, + declarations: [MockComponent(XMoreComponent)], imports: [FormattingModule], providers: [ tableCellProviders( @@ -26,7 +28,7 @@ describe('String array table cell renderer component', () => { }); expect(spectator.query('.first-item')).toHaveText('first-item'); - expect(spectator.query('.summary-text')).toHaveText(''); + expect(spectator.query(XMoreComponent)?.count).toBe(0); }); test('should render an empty array as expected', () => { @@ -35,7 +37,7 @@ describe('String array table cell renderer component', () => { }); expect(spectator.query('.first-item')).toHaveText('-'); - expect(spectator.query('.summary-text')).toHaveText(''); + expect(spectator.query(XMoreComponent)?.count).toBe(0); }); test('should render array with multiple items as expected', () => { @@ -44,6 +46,6 @@ describe('String array table cell renderer component', () => { }); expect(spectator.query('.first-item')).toHaveText('first-item'); - expect(spectator.query('.summary-text')).toHaveText('+2'); + expect(spectator.query(XMoreComponent)?.count).toBe(2); }); }); diff --git a/projects/components/src/table/cells/data-renderers/string-array/string-array-table-cell-renderer.component.ts b/projects/components/src/table/cells/data-renderers/string-array/string-array-table-cell-renderer.component.ts index 996b2a676..aad2e3d7c 100644 --- a/projects/components/src/table/cells/data-renderers/string-array/string-array-table-cell-renderer.component.ts +++ b/projects/components/src/table/cells/data-renderers/string-array/string-array-table-cell-renderer.component.ts @@ -1,13 +1,5 @@ -import { ChangeDetectionStrategy, Component, Inject, OnInit } from '@angular/core'; -import { TableColumnConfig, TableRow } from '../../../table-api'; -import { - TABLE_CELL_DATA, - TABLE_COLUMN_CONFIG, - TABLE_COLUMN_INDEX, - TABLE_DATA_PARSER, - TABLE_ROW_DATA -} from '../../table-cell-injection'; -import { TableCellParserBase } from '../../table-cell-parser-base'; +import { ChangeDetectionStrategy, Component, OnInit } from '@angular/core'; +import { XMoreDisplay } from '../../../../x-more/x-more.component'; import { TableCellRenderer } from '../../table-cell-renderer'; import { TableCellRendererBase } from '../../table-cell-renderer-base'; import { CoreTableCellParserType } from '../../types/core-table-cell-parser-type'; @@ -20,8 +12,8 @@ import { TableCellAlignmentType } from '../../types/table-cell-alignment-type'; changeDetection: ChangeDetectionStrategy.OnPush, template: `