Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
asimonok committed Feb 2, 2024
1 parent fdf1431 commit 5032e60
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 2 deletions src/components/DatasetEditor/DatasetEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -163,15 +163,14 @@ export const DatasetEditor: React.FC<Props> = ({ value, onChange, data }) => {
<div className={styles.column}>
<IconButton
name="trash-alt"
aria-label="Remove"
aria-label={TEST_IDS.datasetEditor.buttonRemove}
onClick={() =>
onChangeItems(
items.filter(
(field) => getDatasetItemUniqueName(field) !== getDatasetItemUniqueName(item)
)
)
}
data-testid={TEST_IDS.datasetEditor.buttonRemove}
/>
<Icon
title="Drag and drop to reorder"
Expand Down
2 changes: 1 addition & 1 deletion src/components/EchartsEditor/EchartsEditor.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ describe('Echarts Editor', () => {
};

const getComponent = ({ ...restProps }: any, context = getContext()) => {
return <EchartsEditor item={{}} {...restProps} context={context} />;
return <EchartsEditor item={{}} value={''} {...restProps} context={context} />;
};

beforeEach(() => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/EchartsEditor/EchartsEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export const EchartsEditor: React.FC<Props> = ({ value, onChange, context, item
<CodeEditor
language={CodeLanguage.JAVASCRIPT}
showLineNumbers={true}
showMiniMap={!!value && value.length > 100}
showMiniMap={value.length > 100}
value={value}
height={context.options?.editor.height}
onBlur={onChange}
Expand Down
2 changes: 1 addition & 1 deletion src/constants/tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const TEST_IDS = {
},
datasetEditor: {
buttonAddNew: 'data-testid dataset-editor button-add-new',
buttonRemove: 'data-testid dataset-editor button-remove',
buttonRemove: 'dataset-editor button-remove',
item: (name: string) => `data-testid dataset-editor item-${name}`,
newItem: 'data-testid dataset-editor new-item',
newItemName: 'dataset-editor new-item-name',
Expand Down

0 comments on commit 5032e60

Please sign in to comment.