summaryrefslogtreecommitdiff
path: root/spec/frontend/lib/utils/chart_utils_spec.js
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-11-15 06:06:13 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-11-15 06:06:13 +0000
commit3fe34368770022c88fd89c8df58b39bf0789e646 (patch)
tree0b8aa07f8b17e4565c491383b5b8b6cc728a1e4a /spec/frontend/lib/utils/chart_utils_spec.js
parent41d446ba3f0518097eb350b142ecfbeeb6be83e6 (diff)
downloadgitlab-ce-3fe34368770022c88fd89c8df58b39bf0789e646.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/lib/utils/chart_utils_spec.js')
-rw-r--r--spec/frontend/lib/utils/chart_utils_spec.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/frontend/lib/utils/chart_utils_spec.js b/spec/frontend/lib/utils/chart_utils_spec.js
new file mode 100644
index 00000000000..e811b8405fb
--- /dev/null
+++ b/spec/frontend/lib/utils/chart_utils_spec.js
@@ -0,0 +1,11 @@
+import { firstAndLastY } from '~/lib/utils/chart_utils';
+
+describe('Chart utils', () => {
+ describe('firstAndLastY', () => {
+ it('returns the first and last y-values of a given data set as an array', () => {
+ const data = [['', 1], ['', 2], ['', 3]];
+
+ expect(firstAndLastY(data)).toEqual([1, 3]);
+ });
+ });
+});