Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -379,16 +379,12 @@ describe('<FollowerIndicesList />', () => {
test('should have a section to render the follower index shards stats', async () => {
await actions.clickFollowerIndexAt(0);
expect(exists('followerIndexDetail.shardsStatsSection')).toBe(true);
});

test('should render a EuiCodeEditor for each shards stats', async () => {
await actions.clickFollowerIndexAt(0);

const codeEditors = component.find(`EuiCodeEditor`);
const codeBlocks = find('shardsStats');

expect(codeEditors.length).toBe(index1.shards.length);
codeEditors.forEach((codeEditor, i) => {
expect(JSON.parse(codeEditor.props().value)).toEqual(index1.shards[i]);
expect(codeBlocks.length).toBe(index1.shards.length);
codeBlocks.forEach((codeBlock, i) => {
expect(JSON.parse(codeBlock.props().children)).toEqual(index1.shards[i]);
});
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
EuiButton,
EuiButtonEmpty,
EuiCallOut,
EuiCodeEditor,
EuiCodeBlock,
EuiDescriptionList,
EuiDescriptionListDescription,
EuiDescriptionListTitle,
Expand Down Expand Up @@ -356,18 +356,9 @@ export class DetailPanel extends Component {
</h3>
</EuiTitle>
<EuiSpacer size="s" />
<EuiCodeEditor
mode="json"
theme="textmate"
width="100%"
isReadOnly
setOptions={{ maxLines: Infinity }}
value={JSON.stringify(shard, null, 2)}
editorProps={{
$blockScrolling: Infinity,
}}
data-test-subj={`shardsStats${i}`}
/>
<EuiCodeBlock language="json" data-test-subj="shardsStats">
{JSON.stringify(shard, null, 2)}
</EuiCodeBlock>
</Fragment>
))}
</section>
Expand Down