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
path: root/spec
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2017-03-27 13:25:50 +0300
committerFilipa Lacerda <filipa@gitlab.com>2017-03-27 13:25:50 +0300
commit7324d6713262d7f9c563d48b82934c4a8eb72a52 (patch)
treecce84b126f8392f4565f0c3929f6fa664c82e226 /spec
parent0281009431821c0e0c2d438561110286200dc3fb (diff)
parentcfd759212dba98aee0f013efd485fa06cad0238f (diff)
Merge branch '29935-add-event-limit-warning-to-all-cycle-analytics-tabs' into 'master'
Resolve "Add event limit warning to all Cycle Analytics tabs" Closes #29935 See merge request !10179
Diffstat (limited to 'spec')
-rw-r--r--spec/javascripts/cycle_analytics/limit_warning_component_spec.js39
1 files changed, 39 insertions, 0 deletions
diff --git a/spec/javascripts/cycle_analytics/limit_warning_component_spec.js b/spec/javascripts/cycle_analytics/limit_warning_component_spec.js
new file mode 100644
index 00000000000..50000c5a5f5
--- /dev/null
+++ b/spec/javascripts/cycle_analytics/limit_warning_component_spec.js
@@ -0,0 +1,39 @@
+import Vue from 'vue';
+import limitWarningComp from '~/cycle_analytics/components/limit_warning_component';
+
+describe('Limit warning component', () => {
+ let component;
+ let LimitWarningComponent;
+
+ beforeEach(() => {
+ LimitWarningComponent = Vue.extend(limitWarningComp);
+ });
+
+ it('should not render if count is not exactly than 50', () => {
+ component = new LimitWarningComponent({
+ propsData: {
+ count: 5,
+ },
+ }).$mount();
+
+ expect(component.$el.textContent.trim()).toBe('');
+
+ component = new LimitWarningComponent({
+ propsData: {
+ count: 55,
+ },
+ }).$mount();
+
+ expect(component.$el.textContent.trim()).toBe('');
+ });
+
+ it('should render if count is exactly 50', () => {
+ component = new LimitWarningComponent({
+ propsData: {
+ count: 50,
+ },
+ }).$mount();
+
+ expect(component.$el.textContent.trim()).toBe('Showing 50 events');
+ });
+});