1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-03-09 00:18:26 +01:00
unleash.unleash/frontend/src/component/changeRequest/ChangeRequest/StrategyTooltipLink/StrategyTooltipLink.test.tsx
Jaanus Sellin e4ca8a3e6c
feat: track search bar events (#6021)
Adding tracking for 2 views, when users use the new search. 

For features view and project view.
2024-01-24 14:23:23 +02:00

55 lines
1.7 KiB
TypeScript

import { render } from 'utils/testRenderer';
import { screen } from '@testing-library/react';
import { StrategyDiff } from './StrategyTooltipLink';
import { IFeatureStrategy } from 'interfaces/strategy';
import { IChangeRequestUpdateStrategy } from 'component/changeRequest/changeRequest.types';
test('Should not render the `snapshot` property', async () => {
const existingStrategy: IFeatureStrategy = {
name: 'flexibleRollout',
constraints: [],
variants: [],
parameters: {
groupId: 'aaa',
rollout: '71',
stickiness: 'default',
},
sortOrder: 0,
id: '31572930-2db7-461f-813b-3eedc200cb33',
title: '',
disabled: false,
segments: [],
};
const change: IChangeRequestUpdateStrategy = {
id: 39,
action: 'updateStrategy' as const,
payload: {
id: '31572930-2db7-461f-813b-3eedc200cb33',
name: 'flexibleRollout',
title: '',
disabled: false,
segments: [],
snapshot: existingStrategy,
variants: [],
parameters: {
groupId: 'aaa',
rollout: '38',
stickiness: 'default',
},
constraints: [],
},
createdAt: new Date('2024-01-18T07:58:36.314Z'),
createdBy: {
id: 1,
username: 'admin',
imageUrl:
'https://gravatar.com/avatar/8c6976e5b5410415bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918?s=42&d=retro&r=g',
},
};
render(<StrategyDiff change={change} currentStrategy={existingStrategy} />);
expect(screen.queryByText(/snapshot/)).toBeNull();
});