diff options
Diffstat (limited to 'spec/frontend/tracing/list_index_spec.js')
-rw-r--r-- | spec/frontend/tracing/list_index_spec.js | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/spec/frontend/tracing/list_index_spec.js b/spec/frontend/tracing/list_index_spec.js new file mode 100644 index 00000000000..a5759035c2f --- /dev/null +++ b/spec/frontend/tracing/list_index_spec.js @@ -0,0 +1,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); + }); +}); |