mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
Remove unnecessary comments
This commit is contained in:
parent
2e105d147f
commit
0fae057871
|
@ -70,10 +70,6 @@ describe('MetricsInput', () => {
|
||||||
|
|
||||||
// Each metric row has a delete button, identified by "button"
|
// Each metric row has a delete button, identified by "button"
|
||||||
const deleteButtons = getAllByRole('button', { name: '' });
|
const deleteButtons = getAllByRole('button', { name: '' });
|
||||||
// Since these are icon buttons, if you have trouble querying by role/name,
|
|
||||||
// consider adding a test-id or using `getAllByTestId('evaluation-metric-item')`
|
|
||||||
// and navigate to its sibling button.
|
|
||||||
|
|
||||||
expect(deleteButtons).toHaveLength(props.modelValue.length);
|
expect(deleteButtons).toHaveLength(props.modelValue.length);
|
||||||
|
|
||||||
// Click on the delete button for the second metric
|
// Click on the delete button for the second metric
|
||||||
|
@ -132,11 +128,9 @@ describe('MetricsInput', () => {
|
||||||
const deleteButtons = getAllByRole('button', { name: '' });
|
const deleteButtons = getAllByRole('button', { name: '' });
|
||||||
await userEvent.click(deleteButtons[0]);
|
await userEvent.click(deleteButtons[0]);
|
||||||
|
|
||||||
// Verify the "deleteMetric" event
|
|
||||||
expect(emitted('deleteMetric')).toBeTruthy();
|
expect(emitted('deleteMetric')).toBeTruthy();
|
||||||
expect(emitted('deleteMetric')[0]).toEqual([{ name: 'Metric 1' }]);
|
expect(emitted('deleteMetric')[0]).toEqual([{ name: 'Metric 1' }]);
|
||||||
|
|
||||||
// Re-render with the updated props (simulating parent update)
|
|
||||||
await rerender({ modelValue: [{ name: 'Metric 2' }] });
|
await rerender({ modelValue: [{ name: 'Metric 2' }] });
|
||||||
const updatedInputs = getAllByPlaceholderText('Enter metric name');
|
const updatedInputs = getAllByPlaceholderText('Enter metric name');
|
||||||
expect(updatedInputs).toHaveLength(1);
|
expect(updatedInputs).toHaveLength(1);
|
||||||
|
|
|
@ -96,7 +96,6 @@ describe('useTestDefinitionForm', () => {
|
||||||
|
|
||||||
it('should handle errors while loading test data', async () => {
|
it('should handle errors while loading test data', async () => {
|
||||||
const { loadTestData } = useTestDefinitionForm();
|
const { loadTestData } = useTestDefinitionForm();
|
||||||
// const fetchSpy = vi.fn().mockRejectedValue(new Error('Fetch Failed'));
|
|
||||||
const fetchSpy = vi
|
const fetchSpy = vi
|
||||||
.spyOn(useTestDefinitionStore(), 'fetchAll')
|
.spyOn(useTestDefinitionStore(), 'fetchAll')
|
||||||
.mockRejectedValue(new Error('Fetch Failed'));
|
.mockRejectedValue(new Error('Fetch Failed'));
|
||||||
|
|
Loading…
Reference in a new issue