diff options
Diffstat (limited to 'spec')
-rw-r--r-- | spec/frontend/behaviors/markdown/render_observability_spec.js | 12 | ||||
-rw-r--r-- | spec/lib/banzai/filter/inline_observability_filter_spec.rb | 52 |
2 files changed, 2 insertions, 62 deletions
diff --git a/spec/frontend/behaviors/markdown/render_observability_spec.js b/spec/frontend/behaviors/markdown/render_observability_spec.js index 03a0cb2fcc2..c87d11742dc 100644 --- a/spec/frontend/behaviors/markdown/render_observability_spec.js +++ b/spec/frontend/behaviors/markdown/render_observability_spec.js @@ -16,7 +16,7 @@ describe('Observability iframe renderer', () => { }); it('renders an observability iframe', () => { - document.body.innerHTML = `<div class="js-render-observability" data-frame-url="https://observe.gitlab.com/" data-observability-url="https://observe.gitlab.com/" ></div>`; + document.body.innerHTML = `<div class="js-render-observability" data-frame-url="https://observe.gitlab.com/"></div>`; expect(findObservabilityIframes()).toHaveLength(0); @@ -26,7 +26,7 @@ describe('Observability iframe renderer', () => { }); it('renders iframe with dark param when GL has dark theme', () => { - document.body.innerHTML = `<div class="js-render-observability" data-frame-url="https://observe.gitlab.com/" data-observability-url="https://observe.gitlab.com/"></div>`; + document.body.innerHTML = `<div class="js-render-observability" data-frame-url="https://observe.gitlab.com/"></div>`; jest.spyOn(ColorUtils, 'darkModeEnabled').mockImplementation(() => true); expect(findObservabilityIframes('dark')).toHaveLength(0); @@ -35,12 +35,4 @@ describe('Observability iframe renderer', () => { expect(findObservabilityIframes('dark')).toHaveLength(1); }); - - it('does not render if url is different from observability url', () => { - document.body.innerHTML = `<div class="js-render-observability" data-frame-url="https://example.com/" data-observability-url="https://observe.gitlab.com/"></div>`; - - renderEmbeddedObservability(); - - expect(findObservabilityIframes()).toHaveLength(0); - }); }); diff --git a/spec/lib/banzai/filter/inline_observability_filter_spec.rb b/spec/lib/banzai/filter/inline_observability_filter_spec.rb index 69a9dc96c2c..fb1ba46e76c 100644 --- a/spec/lib/banzai/filter/inline_observability_filter_spec.rb +++ b/spec/lib/banzai/filter/inline_observability_filter_spec.rb @@ -34,58 +34,6 @@ RSpec.describe Banzai::Filter::InlineObservabilityFilter do end end - context 'when the document contains an embeddable observability link with redirect' do - let(:url) { 'https://observe.gitlab.com@example.com/12345' } - - it 'leaves the original link unchanged' do - expect(doc.at_css('a').to_s).to eq(input) - end - - it 'does not append an observability charts placeholder' do - node = doc.at_css('.js-render-observability') - - expect(node).not_to be_present - end - end - - context 'when the document contains an embeddable observability link with different port' do - let(:url) { 'https://observe.gitlab.com:3000/12345' } - let(:observe_url) { 'https://observe.gitlab.com:3001' } - - before do - stub_env('OVERRIDE_OBSERVABILITY_URL', observe_url) - end - - it 'leaves the original link unchanged' do - expect(doc.at_css('a').to_s).to eq(input) - end - - it 'does not append an observability charts placeholder' do - node = doc.at_css('.js-render-observability') - - expect(node).not_to be_present - end - end - - context 'when the document contains an embeddable observability link with auth/start' do - let(:url) { 'https://observe.gitlab.com/auth/start' } - let(:observe_url) { 'https://observe.gitlab.com' } - - before do - stub_env('OVERRIDE_OBSERVABILITY_URL', observe_url) - end - - it 'leaves the original link unchanged' do - expect(doc.at_css('a').to_s).to eq(input) - end - - it 'does not append an observability charts placeholder' do - node = doc.at_css('.js-render-observability') - - expect(node).not_to be_present - end - end - context 'when feature flag is disabled' do let(:url) { 'https://observe.gitlab.com/12345' } |