blob: a5759035c2fb082195e2f0322b8efee1c0be3edc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
import { shallowMountExtended } from 'helpers/vue_test_utils_helper';
import ListIndex from '~/tracing/list_index.vue';
import TracingList from '~/tracing/components/tracing_list.vue';
import ObservabilityContainer from '~/observability/components/observability_container.vue';
describe('ListIndex', () => {
const props = {
oauthUrl: 'https://example.com/oauth',
tracingUrl: 'https://example.com/tracing',
provisioningUrl: 'https://example.com/provisioning',
};
let wrapper;
const mountComponent = () => {
wrapper = shallowMountExtended(ListIndex, {
propsData: props,
});
};
it('renders ObservabilityContainer component', () => {
mountComponent();
const observabilityContainer = wrapper.findComponent(ObservabilityContainer);
expect(observabilityContainer.exists()).toBe(true);
expect(observabilityContainer.props('oauthUrl')).toBe(props.oauthUrl);
expect(observabilityContainer.props('tracingUrl')).toBe(props.tracingUrl);
expect(observabilityContainer.props('provisioningUrl')).toBe(props.provisioningUrl);
});
it('renders TracingList component inside ObservabilityContainer', () => {
mountComponent();
const observabilityContainer = wrapper.findComponent(ObservabilityContainer);
expect(observabilityContainer.findComponent(TracingList).exists()).toBe(true);
});
});
|