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>2022-11-23 06:11:35 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-11-23 06:11:35 +0300
commit26eeb803e0a3412f0b098d5c5a23f32b763f44c2 (patch)
tree3b509f4a6cc2fce00f8c690f9d0bc0745cbc7d1e /spec/frontend/observability
parent24aaf5f076a73261e242a8f82e90bfb645712597 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/observability')
-rw-r--r--spec/frontend/observability/observability_app_spec.js36
1 files changed, 31 insertions, 5 deletions
diff --git a/spec/frontend/observability/observability_app_spec.js b/spec/frontend/observability/observability_app_spec.js
index f0b318e69ec..d21cf337ee8 100644
--- a/spec/frontend/observability/observability_app_spec.js
+++ b/spec/frontend/observability/observability_app_spec.js
@@ -1,5 +1,8 @@
import { shallowMountExtended } from 'helpers/vue_test_utils_helper';
import ObservabilityApp from '~/observability/components/observability_app.vue';
+import { darkModeEnabled } from '~/lib/utils/color_utils';
+
+jest.mock('~/lib/utils/color_utils');
describe('Observability root app', () => {
let wrapper;
@@ -32,11 +35,34 @@ describe('Observability root app', () => {
wrapper.destroy();
});
- it('should render an iframe with observabilityIframeSrc as src', () => {
- mountComponent();
- const iframe = findIframe();
- expect(iframe.exists()).toBe(true);
- expect(iframe.attributes('src')).toBe(TEST_IFRAME_SRC);
+ describe('iframe src', () => {
+ const TEST_USERNAME = 'test-user';
+
+ beforeAll(() => {
+ gon.current_username = TEST_USERNAME;
+ });
+
+ it('should render an iframe with observabilityIframeSrc, decorated with light theme and username', () => {
+ darkModeEnabled.mockReturnValueOnce(false);
+ mountComponent();
+ const iframe = findIframe();
+
+ expect(iframe.exists()).toBe(true);
+ expect(iframe.attributes('src')).toBe(
+ `${TEST_IFRAME_SRC}&theme=light&username=${TEST_USERNAME}`,
+ );
+ });
+
+ it('should render an iframe with observabilityIframeSrc decorated with dark theme and username', () => {
+ darkModeEnabled.mockReturnValueOnce(true);
+ mountComponent();
+ const iframe = findIframe();
+
+ expect(iframe.exists()).toBe(true);
+ expect(iframe.attributes('src')).toBe(
+ `${TEST_IFRAME_SRC}&theme=dark&username=${TEST_USERNAME}`,
+ );
+ });
});
it('should not call replace method from vue router if message event does not have url', () => {