Skip to content

Commit

Permalink
Refactor CustomPropertyTable test to use updated test IDs and remove …
Browse files Browse the repository at this point in the history
…unnecessary code
  • Loading branch information
Sachin-chaurasiya committed Sep 27, 2024
1 parent 2c51b41 commit 635c9df
Showing 1 changed file with 3 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -153,17 +153,13 @@ describe('Test CustomProperty Table Component', () => {
<CustomPropertyTable {...mockProp} entityType={EntityType.TABLE} />
);
});
const table = await screen.findByTestId('custom-properties-table');
const table = await screen.findByTestId('custom-properties-card');

expect(table).toBeInTheDocument();

const propertyName = await screen.findByText('label.name');
const propertyValue = await screen.findByText('label.value');
const rows = await screen.findAllByRole('row');
const propertyValue = await screen.findByText('PropertyValue');

expect(propertyName).toBeInTheDocument();
expect(propertyValue).toBeInTheDocument();
expect(rows).toHaveLength(mockCustomProperties.length + 1);
});

it('Should render no data placeholder if custom properties list is empty', async () => {
Expand Down Expand Up @@ -222,10 +218,9 @@ describe('Test CustomProperty Table Component', () => {
<CustomPropertyTable {...mockProp} entityType={EntityType.TABLE} />
);
});
const tableRowTitle = await screen.findByText('xName');

const tableRowValue = await screen.findByText('PropertyValue');

expect(tableRowTitle).toBeInTheDocument();
expect(tableRowValue).toBeInTheDocument();
});
});

0 comments on commit 635c9df

Please sign in to comment.