summaryrefslogtreecommitdiff
path: root/spec/javascripts/cycle_analytics
diff options
context:
space:
mode:
authorSam Rose <sam@gitlab.com>2017-03-23 07:54:28 -0400
committerSam Rose <sam@gitlab.com>2017-03-24 18:31:13 -0400
commitcfd759212dba98aee0f013efd485fa06cad0238f (patch)
tree457cdcb1f8d3c4c0cb36fe5e6b54abee5280457a /spec/javascripts/cycle_analytics
parenta634e53ac5d4912777df4f55c77c345c3103205c (diff)
downloadgitlab-ce-cfd759212dba98aee0f013efd485fa06cad0238f.tar.gz
Add event limit warning all tabs Cycle Analytics
Diffstat (limited to 'spec/javascripts/cycle_analytics')
-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');
+ });
+});