Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-04-08 03:09:30 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-04-08 03:09:30 +0300
commit060c842402c00f830a810702600cbe39dfa6cf62 (patch)
tree743bd65ac0c1d4d6518ae8cdd4af5718ec7fb890 /spec/features
parent6867eff1f997a881cd3ea64109f7ba2d4b42fde4 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/features')
-rw-r--r--spec/features/markdown/metrics_spec.rb30
1 files changed, 30 insertions, 0 deletions
diff --git a/spec/features/markdown/metrics_spec.rb b/spec/features/markdown/metrics_spec.rb
index 0d8858a7afd..dadb9571c54 100644
--- a/spec/features/markdown/metrics_spec.rb
+++ b/spec/features/markdown/metrics_spec.rb
@@ -136,6 +136,36 @@ describe 'Metrics rendering', :js, :use_clean_rails_memory_store_caching, :sidek
end
end
+ context 'transient metrics embeds' do
+ let(:metrics_url) { urls.metrics_project_environment_url(project, environment, embed_json: embed_json) }
+ let(:title) { 'Important Metrics' }
+ let(:embed_json) do
+ {
+ panel_groups: [{
+ panels: [{
+ type: "line-graph",
+ title: title,
+ y_label: "metric",
+ metrics: [{
+ query_range: "metric * 0.5 < 1"
+ }]
+ }]
+ }]
+ }.to_json
+ end
+
+ before do
+ stub_any_prometheus_request_with_response
+ end
+
+ it 'shows embedded metrics' do
+ visit project_issue_path(project, issue)
+
+ expect(page).to have_css('div.prometheus-graph')
+ expect(page).to have_text(title)
+ end
+ end
+
def import_common_metrics
::Gitlab::DatabaseImporters::CommonMetrics::Importer.new.execute
end