Commit e95a58f3 authored by Adrien Kohlbecker's avatar Adrien Kohlbecker Committed by Kushal Pandya

Fix k8s logs alert display state

parent 7343c4f2
---
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');
......@@ -224,6 +225,10 @@ describe('EnvironmentLogs', () => {
expect(actionMocks.setSearch).not.toHaveBeenCalled();
});
it('displays an alert to upgrade to ES', () => {
expect(findInfoAlert().exists()).toBe(true);
});
});
describe('state with data', () => {
......@@ -259,6 +264,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