Commit a25f2ea8 authored by Kushal Pandya's avatar Kushal Pandya

Merge branch 'ak/fix-alert' into 'master'

Fix k8s logs alert display state

See merge request gitlab-org/gitlab!24802
parents 88a46833 e95a58f3
---
title: Fix k8s logs alert display state
merge_request: 24802
author:
type: fixed
......@@ -72,11 +72,7 @@ export default {
return this.environments.isLoading || !this.advancedFeaturesEnabled;
},
shouldShowElasticStackCallout() {
return (
!this.isElasticStackCalloutDismissed &&
!this.logs.isLoading &&
!this.disableAdvancedControls
);
return !this.isElasticStackCalloutDismissed && this.disableAdvancedControls;
},
},
watch: {
......@@ -114,7 +110,7 @@ export default {
<div class="build-page-pod-logs mt-3">
<gl-alert
v-if="shouldShowElasticStackCallout"
class="mb-3"
class="mb-3 js-elasticsearch-alert"
@dismiss="isElasticStackCalloutDismissed = true"
>
{{
......
......@@ -46,6 +46,7 @@ describe('EnvironmentLogs', () => {
const findPodsDropdown = () => wrapper.find('.js-pods-dropdown');
const findSearchBar = () => wrapper.find('.js-logs-search');
const findTimeRangePicker = () => wrapper.find({ ref: 'dateTimePicker' });
const findInfoAlert = () => wrapper.find('.js-elasticsearch-alert');
const findLogControlButtons = () => wrapper.find({ name: 'log-control-buttons-stub' });
const findLogTrace = () => wrapper.find('.js-log-trace');
......@@ -217,6 +218,10 @@ describe('EnvironmentLogs', () => {
it('displays a disabled search bar', () => {
expect(findSearchBar().attributes('disabled')).toBe('true');
});
it('displays an alert to upgrade to ES', () => {
expect(findInfoAlert().exists()).toBe(true);
});
});
describe('state with data', () => {
......@@ -252,6 +257,10 @@ describe('EnvironmentLogs', () => {
expect(findTimeRangePicker().attributes('disabled')).toBeFalsy();
});
it('does not display an alert to upgrade to ES', () => {
expect(findInfoAlert().exists()).toBe(false);
});
it('populates environments dropdown', () => {
const items = findEnvironmentsDropdown().findAll(GlDropdownItem);
expect(findEnvironmentsDropdown().props('text')).toBe(mockEnvName);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment