From fb7489ffd0ac3d0b70ead24b6ed197e44bb22d58 Mon Sep 17 00:00:00 2001
From: Jonas Jenwald <jonas.jenwald@gmail.com>
Date: Sat, 30 Aug 2014 22:12:34 +0200
Subject: [PATCH] Add getStats unit test

Since some Telemetry data depends on `getStats`, having a unit test should make it more diffucult to accidentally break this without noticing.
---
 test/unit/api_spec.js | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/test/unit/api_spec.js b/test/unit/api_spec.js
index 3019b2650..f82e960d9 100644
--- a/test/unit/api_spec.js
+++ b/test/unit/api_spec.js
@@ -1,6 +1,7 @@
 /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
-/* globals PDFJS, expect, it, describe, Promise, combineUrl, waitsFor */
+/* globals PDFJS, expect, it, describe, Promise, combineUrl, waitsFor,
+           isArray */
 
 'use strict';
 
@@ -141,6 +142,13 @@ describe('api', function() {
         expect(data.length).toEqual(105779);
       });
     });
+    it('gets stats', function() {
+      var promise = doc.getStats();
+      waitsForPromise(promise, function (stats) {
+        expect(isArray(stats.streamTypes)).toEqual(true);
+        expect(isArray(stats.fontTypes)).toEqual(true);
+      });
+    });
   });
   describe('Page', function() {
     var resolvePromise;