From f4b8fe20ec86b61903d184dcefc4ff3f3f9628b1 Mon Sep 17 00:00:00 2001 From: ThinkRedstone Date: Sun, 20 Aug 2017 18:09:29 +0300 Subject: [PATCH 01/11] Changed sorting icons to a material-icons versions in ranking --- src/js/views/ranking.js | 10 +++++----- src/views/pages/ranking.html | 14 +++++++------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/js/views/ranking.js b/src/js/views/ranking.js index 479a6055..5fb978e3 100644 --- a/src/js/views/ranking.js +++ b/src/js/views/ranking.js @@ -70,15 +70,15 @@ define('views/ranking',[ var icon = ''; if (stage.sort == col) { if (stage.rev){ - icon = 'icon-sort-down'; + icon = 'arrow_drop_down'; } else { - icon = 'icon-sort-up'; + icon = 'arrow_drop_up'; } } else if (stage.sort === undefined && col == $scope.sort) { if (stage.rev === undefined && $scope.rev) { - icon = 'icon-sort-down'; + icon = 'arrow_drop_down'; } else { - icon = 'icon-sort-up'; + icon = 'arrow_drop_up'; } } else { icon = ''; // no icon if column is not sorted @@ -159,7 +159,7 @@ define('views/ranking',[ $scope.getRoundLabel = function(round){ return "Round " + round; }; - + } ]); diff --git a/src/views/pages/ranking.html b/src/views/pages/ranking.html index e20bb320..5f9c0d66 100644 --- a/src/views/pages/ranking.html +++ b/src/views/pages/ranking.html @@ -41,27 +41,27 @@

Rank - + {{sortIcon(stage, 'rank')}} Team - + {{sortIcon(stage, 'team.number')}} Name - + {{sortIcon(stage, 'team.name')}} Highest - + {{sortIcon(stage, 'highest')}} Score - + {{sortIcon(stage, 'highest')}} Round {{round}} - + {{sortIcon(stage, 'scores['+$index+']')}} @@ -69,7 +69,7 @@

- + {{item.rank}} {{item.team.number}} {{item.team.name}} From fe8f09ab0b25f5fb3bb389514bd047e96f91a7ea Mon Sep 17 00:00:00 2001 From: ThinkRedstone Date: Sun, 20 Aug 2017 20:15:50 +0300 Subject: [PATCH 02/11] added sorting icons to scores.html --- src/js/views/scores.js | 12 +++++++++++ src/views/pages/scores.html | 41 ++++++++++++++++++++++++++++--------- 2 files changed, 43 insertions(+), 10 deletions(-) diff --git a/src/js/views/scores.js b/src/js/views/scores.js index 574ab79c..d393cdfc 100644 --- a/src/js/views/scores.js +++ b/src/js/views/scores.js @@ -20,6 +20,18 @@ define('views/scores',[ $scope.rev = (String($scope.sort) === String(col)) ? !$scope.rev : !!defaultSort; $scope.sort = col; }; + + $scope.sortIcon = function(col){ + if(String($scope.sort)!== String(col)){//col and $scope.sort can be arrays, and so this is a quick and dirty way to check for equality + return ''; + } + if ($scope.rev) { + return 'arrow_drop_down'; + } else { + return 'arrow_drop_up'; + } + }; + $scope.removeScore = function(index) { $scores.remove(index); return $scores.save(); diff --git a/src/views/pages/scores.html b/src/views/pages/scores.html index 0e21587c..78c2bab7 100644 --- a/src/views/pages/scores.html +++ b/src/views/pages/scores.html @@ -14,19 +14,40 @@

Showing {{scores.length}} scores.

- - - - - - - - + + + + + + + + - - + + - + diff --git a/src/views/pages/scores.html b/src/views/pages/scores.html index aedc41d4..9e87f0be 100644 --- a/src/views/pages/scores.html +++ b/src/views/pages/scores.html @@ -14,34 +14,34 @@

Showing {{scores.length}} scores.

#StageRoundTableTeamNameScore
+ # + {{sortIcon('index')}} + + Stage + {{sortIcon(['stage.index','-index'])}} + + Round + {{sortIcon(['stage.index','round','-index'])}} + + Table + {{sortIcon('table')}} + + Team + {{sortIcon('team.number')}} + + Name + {{sortIcon('team.name')}} + + Score + {{sortIcon('score')}} + Action
{{score.index + 1}}
{{$index + 1}} error From 2800b81c9b9ed8641bd4b7027db6fc14f7f6b0c2 Mon Sep 17 00:00:00 2001 From: ThinkRedstone Date: Sun, 20 Aug 2017 20:20:11 +0300 Subject: [PATCH 03/11] changed test for ranking to use the new material-icons --- spec/views/rankingSpec.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/spec/views/rankingSpec.js b/spec/views/rankingSpec.js index f93b6c12..e0851f35 100644 --- a/spec/views/rankingSpec.js +++ b/spec/views/rankingSpec.js @@ -79,7 +79,7 @@ describe('ranking', function() { sort: 'foo' }; expect($scope.sortIcon(stage)).toEqual(''); - expect($scope.sortIcon(stage,'foo')).toEqual('icon-sort-up'); + expect($scope.sortIcon(stage,'foo')).toEqual('arrow_drop_up'); }); it('should give the up icon when col is sorted in reverse',function() { var stage = { @@ -87,15 +87,15 @@ describe('ranking', function() { rev: true }; expect($scope.sortIcon(stage)).toEqual(''); - expect($scope.sortIcon(stage,'foo')).toEqual('icon-sort-down'); + expect($scope.sortIcon(stage,'foo')).toEqual('arrow_drop_down'); }); //default sort order stuff, needs a bit of refactoring it('should report a default sorting for any stage',function() { var stage = {}; - expect($scope.sortIcon(stage,'rank')).toEqual('icon-sort-up'); + expect($scope.sortIcon(stage,'rank')).toEqual('arrow_drop_up'); $scope.rev = true; - expect($scope.sortIcon(stage,'rank')).toEqual('icon-sort-down'); + expect($scope.sortIcon(stage,'rank')).toEqual('arrow_drop_down'); }); }); From 588bd3828feb6a1cb51ae1bcd9dde3ffddd28328 Mon Sep 17 00:00:00 2001 From: ThinkRedstone Date: Sun, 20 Aug 2017 20:59:17 +0300 Subject: [PATCH 04/11] changed score.index to $index in scores.html --- src/views/pages/scores.html | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/views/pages/scores.html b/src/views/pages/scores.html index 78c2bab7..aedc41d4 100644 --- a/src/views/pages/scores.html +++ b/src/views/pages/scores.html @@ -97,39 +97,39 @@

From 9efa2403355ba9967d8258936c92f6e6e003a2d3 Mon Sep 17 00:00:00 2001 From: ThinkRedstone Date: Sun, 20 Aug 2017 22:43:32 +0300 Subject: [PATCH 05/11] Moved css properties of sortable fields to elements.css under sortable class --- src/css/elements.css | 8 ++++++++ src/views/pages/ranking.html | 26 +++++++++++++------------- src/views/pages/scores.html | 30 +++++++++++++++--------------- 3 files changed, 36 insertions(+), 28 deletions(-) diff --git a/src/css/elements.css b/src/css/elements.css index e4f8cbe6..4e02793c 100644 --- a/src/css/elements.css +++ b/src/css/elements.css @@ -327,3 +327,11 @@ button .material-icons { display: none !important; } } + +.sortable span{ + float: left; +} + +.sortable i{ + float: right; +} diff --git a/src/views/pages/ranking.html b/src/views/pages/ranking.html index 5f9c0d66..51405f1a 100644 --- a/src/views/pages/ranking.html +++ b/src/views/pages/ranking.html @@ -38,30 +38,30 @@

ng-if="stage.rounds > 0" >

- Rank - {{sortIcon(stage, 'rank')}} + Rank + {{sortIcon(stage, 'rank')}} - Team - {{sortIcon(stage, 'team.number')}} + Team + {{sortIcon(stage, 'team.number')}} - Name - {{sortIcon(stage, 'team.name')}} + Name + {{sortIcon(stage, 'team.name')}} - Highest - {{sortIcon(stage, 'highest')}} + Highest + {{sortIcon(stage, 'highest')}} - Score - {{sortIcon(stage, 'highest')}} + Score + {{sortIcon(stage, 'highest')}} - Round {{round}} - {{sortIcon(stage, 'scores['+$index+']')}} + Round {{round}} + {{sortIcon(stage, 'scores['+$index+']')}}
- + From b5e75f57406d74b1e3ad3954aab77e2a115d0427 Mon Sep 17 00:00:00 2001 From: ThinkRedstone Date: Tue, 22 Aug 2017 02:04:26 +0300 Subject: [PATCH 06/11] Removed broken export dialog --- src/js/views/ranking.js | 3 +- src/views/dialogs.html | 167 ----------------------------------- src/views/pages/ranking.html | 3 - 3 files changed, 1 insertion(+), 172 deletions(-) diff --git a/src/js/views/ranking.js b/src/js/views/ranking.js index 5fb978e3..e0750a2b 100644 --- a/src/js/views/ranking.js +++ b/src/js/views/ranking.js @@ -5,11 +5,10 @@ define('views/ranking',[ 'services/ng-scores', 'services/ng-handshake', 'services/ng-message', - 'controllers/ExportRankingDialogController', 'angular' ],function(log) { var moduleName = 'ranking'; - return angular.module(moduleName,['ExportRankingDialog']).controller(moduleName+'Ctrl', [ + return angular.module(moduleName,[]).controller(moduleName+'Ctrl', [ '$scope', '$scores', '$stages','$handshake','$message', function($scope, $scores, $stages, $handshake, $message) { log('init ranking ctrl'); diff --git a/src/views/dialogs.html b/src/views/dialogs.html index b3e34e47..205e48c2 100644 --- a/src/views/dialogs.html +++ b/src/views/dialogs.html @@ -156,170 +156,3 @@

-
-
-

-
arrow_back
- Export ranking to standalone file - -

-
-

- # - {{sortIcon('index')}} + # + {{sortIcon('index')}} - Stage - {{sortIcon(['stage.index','-index'])}} + Stage + {{sortIcon(['stage.index','-index'])}} - Round - {{sortIcon(['stage.index','round','-index'])}} + Round + {{sortIcon(['stage.index','round','-index'])}} - Table - {{sortIcon('table')}} + Table + {{sortIcon('table')}} - Team - {{sortIcon('team.number')}} + Team + {{sortIcon('team.number')}} - Name - {{sortIcon('team.name')}} + Name + {{sortIcon('team.name')}} - Score - {{sortIcon('score')}} + Score + {{sortIcon('score')}} Action
- - - - - - - - - - - - - - - - - - -
- Rank - - Team - - Name - - Highest - - Round {{round}} -
{{item.rank}}{{item.team.number}}{{item.team.name}}{{item.highest}}{{score}}
- -

-

- -

- - - - diff --git a/src/views/pages/ranking.html b/src/views/pages/ranking.html index 5f9c0d66..f095ce16 100644 --- a/src/views/pages/ranking.html +++ b/src/views/pages/ranking.html @@ -6,9 +6,6 @@

{{currentPage.title}}

- - -
From b779a516a843723372aaec34edad7a9ea217a73e Mon Sep 17 00:00:00 2001 From: ThinkRedstone Date: Tue, 22 Aug 2017 02:21:45 +0300 Subject: [PATCH 07/11] Added settings for formatting exported scores --- src/views/pages/settings.html | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/src/views/pages/settings.html b/src/views/pages/settings.html index 5c20fb1b..5401d7d4 100644 --- a/src/views/pages/settings.html +++ b/src/views/pages/settings.html @@ -97,6 +97,23 @@

Scoresheet

+
+

Score Export Format

+
+

+ + +

+

+ + +

+

+ + +

+
+
@@ -119,7 +136,7 @@

-

+

@@ -130,7 +147,7 @@

- + shared host to get data from and save data to. E.g. 'http://localhost:1390/' @@ -138,7 +155,7 @@

- + currently the filename containing missions! E.g. '2016_en_US' (no file extension) @@ -147,28 +164,28 @@

- + Enable publishing of scores and rankings, live updates to the score keeping lists, etc.

- + MHub server to send messages to. E.g. 'ws://localhost:13900/'

- + MHub server node to subscribe and publish to. E.g. 'scoring'

-

Log

+

Log

             {{line}}
From 5a0d2366d26ec112997a71199fda8ded570a3e3e Mon Sep 17 00:00:00 2001 From: ThinkRedstone Date: Tue, 22 Aug 2017 04:00:11 +0300 Subject: [PATCH 08/11] Changed export function to abide user settings --- src/js/views/ranking.js | 85 +++++++++++++++++------------------- src/views/pages/ranking.html | 2 +- 2 files changed, 42 insertions(+), 45 deletions(-) diff --git a/src/js/views/ranking.js b/src/js/views/ranking.js index e0750a2b..77ef1f27 100644 --- a/src/js/views/ranking.js +++ b/src/js/views/ranking.js @@ -5,12 +5,13 @@ define('views/ranking',[ 'services/ng-scores', 'services/ng-handshake', 'services/ng-message', + 'services/ng-settings', 'angular' ],function(log) { var moduleName = 'ranking'; return angular.module(moduleName,[]).controller(moduleName+'Ctrl', [ - '$scope', '$scores', '$stages','$handshake','$message', - function($scope, $scores, $stages, $handshake, $message) { + '$scope', '$scores', '$stages','$handshake','$message', '$settings', + function($scope, $scores, $stages, $handshake, $message, $settings) { log('init ranking ctrl'); // temporary default sort values @@ -101,57 +102,53 @@ define('views/ranking',[ return new Array($scope.maxRounds() - stage.$rounds.length); }; - // Data for CSV export links, indexed by stage ID - $scope.csvdata = {}; // CSV data itself - $scope.csvname = {}; // Filenames suggested to user - - // Convert a 2D matrix to a CSV string. - // All cells are converted to strings and fully quoted, - // except null or undefined cells, which are passed as empty - // values (without quotes). - function toCSV(rows) { - return rows.map(function(row) { - return row.map(function(col) { - // Escape quotes, and wrap in quotes - if (col === undefined || col === null) { - col = ""; - } - return '"' + String(col).replace(/"/gi, '""') + '"'; - }).join(","); - }).join("\r\n"); // Use Windows line-endings, to make it Notepad-friendly - } + /** + * encodes a two dimensional array as a string according to the settings + * specified by the user as reported by the ng-settings.$settings service + * + * @param array the array to be encoded + * @returns {string} the encoded string form of the array + */ + $scope.encodeArray = function (array) { + var string = ""; + var settings = $settings.settings; + array.forEach(function (row) { + row = row.map(String); + string = string.concat(settings.lineStartString ? String(settings.lineStartString) : ""); + string = string.concat(row.join(settings.separatorString ? String(settings.separatorString) : "")); + string = string.concat((settings.lineEndString ? String(settings.lineEndString) : "") + "\n"); + }); + return string; + }; + + $scope.exportFiles = {}; /** - * Rebuild CSV data (contents and filenames) of given scoreboard. - * @param scoreboard Per-stage ranking as present in e.g. $scores.scoreboard. + * Builds the .csv file for exporting score for each stage and assigns it + * to exportFiles in the field corresponding to that stage's id */ - $scope.rebuildCSV = function(scoreboard) { - $scope.csvdata = {}; - $scope.csvname = {}; - Object.keys(scoreboard).forEach(function(stageId) { - var ranking = scoreboard[stageId]; - var rows = ranking.map(function(entry) { - return [ - entry.rank, - entry.team.number, - entry.team.name, - entry.highest, - ].concat(entry.scores); + $scope.buildExportFiles= function () { + Object.keys($scope.scoreboard).forEach(function (stageID) { + var teams = $scope.scoreboard[stageID]; + teams = teams.map(function (teamEntry) { + return [teamEntry.rank, teamEntry.team.number, + teamEntry.team.name, teamEntry.highest].concat(teamEntry.scores); }); - var header = ["Rank", "Team Number", "Team Name", "Highest"]; - var stage = $stages.get(stageId); - header = header.concat(stage.$rounds.map(function(round) { return "Round " + round; })); - rows.unshift(header); - $scope.csvname[stageId] = encodeURIComponent("ranking_" + stageId + ".csv"); - $scope.csvdata[stageId] = "data:text/csv;charset=utf-8," + encodeURIComponent(toCSV(rows)); + $scope.exportFiles[stageID] = "data:text/csv;charset=utf-8,"+encodeURIComponent($scope.encodeArray(teams)); }); }; - // Rebuild CSV data and filenames when scoreboard is updated - $scope.$watch("scoreboard", function() { - $scope.rebuildCSV($scores.scoreboard); + $scope.$watch("scoreboard", function () { + $scope.buildExportFiles(); }, true); + $scope.$watchCollection("settings", function () {//we need to rebuild the files if the user changes his export format + $scope.buildExportFiles(); + }); + + $settings.init().then(function () {//we have to wait for settings to initialize otherwise $scope.settings gets set to undefined + $scope.settings = $settings.settings; + }); $scope.stages = $stages.stages; $scope.scoreboard = $scores.scoreboard; diff --git a/src/views/pages/ranking.html b/src/views/pages/ranking.html index f095ce16..09dba32a 100644 --- a/src/views/pages/ranking.html +++ b/src/views/pages/ranking.html @@ -10,7 +10,7 @@

- + file_download Export From 4b925800117cff330aeda964c6ea6157ae0805aa Mon Sep 17 00:00:00 2001 From: ThinkRedstone Date: Tue, 22 Aug 2017 15:16:42 +0300 Subject: [PATCH 09/11] made array encoding notepad-friendly --- src/js/views/ranking.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/views/ranking.js b/src/js/views/ranking.js index 77ef1f27..c4dc882b 100644 --- a/src/js/views/ranking.js +++ b/src/js/views/ranking.js @@ -116,7 +116,7 @@ define('views/ranking',[ row = row.map(String); string = string.concat(settings.lineStartString ? String(settings.lineStartString) : ""); string = string.concat(row.join(settings.separatorString ? String(settings.separatorString) : "")); - string = string.concat((settings.lineEndString ? String(settings.lineEndString) : "") + "\n"); + string = string.concat((settings.lineEndString ? String(settings.lineEndString) : "") + "\r\n"); }); return string; }; From e1cae7498f7097d959a2b010dc2ab27db21ef9d6 Mon Sep 17 00:00:00 2001 From: ThinkRedstone Date: Tue, 22 Aug 2017 15:48:04 +0300 Subject: [PATCH 10/11] Replaces undefined or null fields with an empty string in exported files --- src/js/views/ranking.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/views/ranking.js b/src/js/views/ranking.js index c4dc882b..2610cd6c 100644 --- a/src/js/views/ranking.js +++ b/src/js/views/ranking.js @@ -113,7 +113,7 @@ define('views/ranking',[ var string = ""; var settings = $settings.settings; array.forEach(function (row) { - row = row.map(String); + row = row.map((elem) => elem || elem === 0 ? String(elem) : ""); string = string.concat(settings.lineStartString ? String(settings.lineStartString) : ""); string = string.concat(row.join(settings.separatorString ? String(settings.separatorString) : "")); string = string.concat((settings.lineEndString ? String(settings.lineEndString) : "") + "\r\n"); From a3c4b7847d180b325bc5d3a3b9790cc2625d26d6 Mon Sep 17 00:00:00 2001 From: ThinkRedstone Date: Tue, 22 Aug 2017 16:25:43 +0300 Subject: [PATCH 11/11] Changed test in accordance with the new export file format and expanded them --- spec/views/rankingSpec.js | 64 ++++++++++++++++++++++++--------------- 1 file changed, 39 insertions(+), 25 deletions(-) diff --git a/spec/views/rankingSpec.js b/spec/views/rankingSpec.js index e0851f35..59642ad1 100644 --- a/spec/views/rankingSpec.js +++ b/spec/views/rankingSpec.js @@ -10,7 +10,7 @@ describe('ranking', function() { number: '123', name: 'foo' }; - var fsMock, stagesMock, scoresMock, handshakeMock, messageMock; + var fsMock, stagesMock, scoresMock, handshakeMock, messageMock, settingsMock; beforeEach(function() { angular.mock.module(module.name); @@ -18,24 +18,30 @@ describe('ranking', function() { $scope = $rootScope.$new(); scoresMock = createScoresMock($q); handshakeMock = createHandshakeMock($q); - stagesMock = createStagesMock(); + stagesMock = createStagesMock($q); messageMock = createMessageMock(); + var settings = {}; + settings.lineStartString = "\""; + settings.lineEndString = "\""; + settings.separatorString = "\",\""; + settingsMock = createSettingsMock($q, settings); controller = $controller('rankingCtrl', { '$scope': $scope, '$scores': scoresMock, '$stages': stagesMock, '$handshake': handshakeMock, - '$message': messageMock + '$message': messageMock, + '$settings': settingsMock, }); }); + $scope.$digest();//resolves all init promises, etc. }); describe('initialization', function() { it('should initialize', function() { expect($scope.sort).toEqual('rank'); expect($scope.rev).toEqual(false); - expect($scope.csvdata).toEqual({}); - expect($scope.csvname).toEqual({}); + expect($scope.exportFiles).toEqual({}); }); }); @@ -134,47 +140,55 @@ describe('ranking', function() { }); }); - describe('rebuildCSV',function() { - it('should generate CSV data and filenames',function() { - expect($scope.csvname).toEqual({}); - expect($scope.csvdata).toEqual({}); - $scope.rebuildCSV({ + describe('buildExportFiles',function() { + it('should generate export files',function() { + expect($scope.exportFiles).toEqual({}); + + $scope.scoreboard = { 'qualifying': [ { rank: 1, team: { name: "foo", number: 123 }, highest: 10, scores: [0, 10, 5] }, { rank: 1, team: { name: "\"bar\"", number: 456 }, highest: 10, scores: [10, 0, 5] } ] - }); - expect($scope.csvname["qualifying"]).toEqual("ranking_qualifying.csv"); - expect($scope.csvdata["qualifying"]).toEqual("data:text/csv;charset=utf-8," + encodeURIComponent([ - '"Rank","Team Number","Team Name","Highest","Round 1","Round 2","Round 3"', + }; + $scope.buildExportFiles(); + expect($scope.exportFiles["qualifying"]).toEqual("data:text/csv;charset=utf-8," + encodeURIComponent([ '"1","123","foo","10","0","10","5"', - '"1","456","""bar""","10","10","0","5"', - ].join("\r\n"))); + '"1","456",""bar"","10","10","0","5"', //new format doesn't replace every quotation mark with two + ].join("\r\n").concat("\r\n")));//new format ends in a newline }); it('should not skip empty values, but include as empty string',function() { - $scope.rebuildCSV({ + $scope.scoreboard = { 'qualifying': [ { team: { name: "foo", number: 123 }, highest: 10, scores: [0, 10, 5] }, { team: { name: "\"bar\"", number: 456 }, highest: 10, scores: [10, 0, 5] } ] - }); - expect($scope.csvdata["qualifying"]).toEqual("data:text/csv;charset=utf-8," + encodeURIComponent([ - '"Rank","Team Number","Team Name","Highest","Round 1","Round 2","Round 3"', + }; + $scope.$digest(); + expect($scope.exportFiles["qualifying"]).toEqual("data:text/csv;charset=utf-8," + encodeURIComponent([ '"","123","foo","10","0","10","5"', - '"","456","""bar""","10","10","0","5"', - ].join("\r\n"))); + '"","456",""bar"","10","10","0","5"', //new format doesn't replace every quotation mark with two + ].join("\r\n").concat("\r\n")));//new format ends in a newline }); }); describe('scoreboard watcher',function() { - it('should rebuild the csv when the scoreboard changes',function() { - $scope.rebuildCSV = jasmine.createSpy('rebuildCSV'); + it('should rebuild the export files when the scoreboard changes',function() { + $scope.buildExportFiles = jasmine.createSpy('buildExportFiles'); $scope.scoreboard = 'foo'; $scope.$digest(); - expect($scope.rebuildCSV).toHaveBeenCalledWith(scoresMock.scoreboard); + expect($scope.buildExportFiles).toHaveBeenCalled(); }); }); + describe('settings watcher', function () { + it('should rebuild the export files when the settings change', function () { + $scope.buildExportFiles = jasmine.createSpy('buildExportFiles'); + $scope.settings.bla = "fo"; + $scope.$digest(); + expect($scope.buildExportFiles).toHaveBeenCalled(); + }) + }); + describe('getRoundLabel',function() { it('should create a label for rounds',function() { expect($scope.getRoundLabel(4)).toEqual('Round 4');