Commit e2088289 authored by Natalia Tepluhina's avatar Natalia Tepluhina

Merge branch 'ek-remove-limit-warning-component' into 'master'

Removes the limit warning component

See merge request gitlab-org/gitlab!81132
parents 898e870a 79d020bb
<script>
import { GlIcon, GlTooltipDirective } from '@gitlab/ui';
export default {
components: {
GlIcon,
},
directives: {
GlTooltip: GlTooltipDirective,
},
props: {
count: {
type: Number,
required: true,
},
},
};
</script>
<template>
<span v-if="count === 50" class="events-info float-right">
<gl-icon
v-gl-tooltip="{
title: n__(
'Limited to showing %d event at most',
'Limited to showing %d events at most',
50,
),
}"
name="warning"
/>
{{ n__('Showing %d event', 'Showing %d events', 50) }}
</span>
</template>
......@@ -21936,11 +21936,6 @@ msgstr ""
msgid "Limit the size of Sidekiq jobs stored in Redis."
msgstr ""
msgid "Limited to showing %d event at most"
msgid_plural "Limited to showing %d events at most"
msgstr[0] ""
msgstr[1] ""
msgid "Limiting mode"
msgstr ""
......@@ -33833,11 +33828,6 @@ msgstr ""
msgid "Show whitespace changes"
msgstr ""
msgid "Showing %d event"
msgid_plural "Showing %d events"
msgstr[0] ""
msgstr[1] ""
msgid "Showing %{conflict} between %{sourceBranch} and %{targetBranch}"
msgstr ""
......
import { shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import LimitWarningComponent from '~/cycle_analytics/components/limit_warning_component.vue';
import Translate from '~/vue_shared/translate';
Vue.use(Translate);
const createComponent = (props) =>
shallowMount(LimitWarningComponent, {
propsData: {
...props,
},
});
describe('Limit warning component', () => {
let component;
beforeEach(() => {
component = null;
});
afterEach(() => {
component.destroy();
});
it('should not render if count is not exactly than 50', () => {
component = createComponent({ count: 5 });
expect(component.text().trim()).toBe('');
component = createComponent({ count: 55 });
expect(component.text().trim()).toBe('');
});
it('should render if count is exactly 50', () => {
component = createComponent({ count: 50 });
expect(component.text().trim()).toBe('Showing 50 events');
});
});
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