diff options
author | Stas Vilchik <vilchiks@gmail.com> | 2015-03-16 15:41:16 +0100 |
---|---|---|
committer | Stas Vilchik <vilchiks@gmail.com> | 2015-03-16 15:41:16 +0100 |
commit | 3ca885f38cd9fee24961846c15a4ef5fa200796e (patch) | |
tree | f46af2474ad143a11b84b24a3998f56dccc24d6d /server | |
parent | d9c779b75f539efd0861bf8147e88d4456369448 (diff) | |
download | sonarqube-3ca885f38cd9fee24961846c15a4ef5fa200796e.tar.gz sonarqube-3ca885f38cd9fee24961846c15a4ef5fa200796e.zip |
fix web test
Diffstat (limited to 'server')
-rw-r--r-- | server/sonar-web/src/main/coffee/issues/workspace-home-view.coffee | 35 | ||||
-rw-r--r-- | server/sonar-web/src/test/js/issues-page-spec.js | 6 |
2 files changed, 21 insertions, 20 deletions
diff --git a/server/sonar-web/src/main/coffee/issues/workspace-home-view.coffee b/server/sonar-web/src/main/coffee/issues/workspace-home-view.coffee index 704dbb28834..75c9ed9bf93 100644 --- a/server/sonar-web/src/main/coffee/issues/workspace-home-view.coffee +++ b/server/sonar-web/src/main/coffee/issues/workspace-home-view.coffee @@ -57,30 +57,33 @@ define [ _getProjects: (r) -> projectFacet = _.findWhere r.facets, property: 'projectUuids' - values = _.head projectFacet.values, 3 - values.forEach (v) => - project = _.findWhere r.projects, uuid: v.val - v.label = project.longName - values + if projectFacet? + values = _.head projectFacet.values, 3 + values.forEach (v) => + project = _.findWhere r.projects, uuid: v.val + v.label = project.longName + values _getAuthors: (r) -> authorFacet = _.findWhere r.facets, property: 'authors' - values = _.head authorFacet.values, 3 - values + if authorFacet? + values = _.head authorFacet.values, 3 + values _getTags: (r) -> MIN_SIZE = 10 MAX_SIZE = 24 tagFacet = _.findWhere r.facets, property: 'tags' - values = _.head tagFacet.values, 10 - minCount = _.min(values, (v) -> v.count).count - maxCount = _.max(values, (v) -> v.count).count - scale = d3.scale.linear().domain([minCount, maxCount]).range([MIN_SIZE, MAX_SIZE]) - values.forEach (v) => - v.size = scale v.count - values + if tagFacet? + values = _.head tagFacet.values, 10 + minCount = _.min(values, (v) -> v.count).count + maxCount = _.max(values, (v) -> v.count).count + scale = d3.scale.linear().domain([minCount, maxCount]).range([MIN_SIZE, MAX_SIZE]) + values.forEach (v) => + v.size = scale v.count + values requestIssues: -> @@ -92,7 +95,7 @@ define [ facets: 'createdAt,projectUuids,authors,tags' $.get(url, options).done (r) => @model.set - createdAt: _.findWhere(r.facets, property: 'createdAt').values + createdAt: _.findWhere(r.facets, property: 'createdAt')?.values projects: @_getProjects r authors: @_getAuthors r tags: @_getTags r @@ -108,7 +111,7 @@ define [ facets: 'createdAt,projectUuids,authors,tags' $.get(url, options).done (r) => @model.set - myCreatedAt: _.findWhere(r.facets, property: 'createdAt').values + myCreatedAt: _.findWhere(r.facets, property: 'createdAt')?.values myProjects: @_getProjects r myTags: @_getTags r diff --git a/server/sonar-web/src/test/js/issues-page-spec.js b/server/sonar-web/src/test/js/issues-page-spec.js index 5aca02d5ad5..c184e8262f7 100644 --- a/server/sonar-web/src/test/js/issues-page-spec.js +++ b/server/sonar-web/src/test/js/issues-page-spec.js @@ -324,7 +324,7 @@ casper.test.begin(testName('Bulk Change'), function (test) { lib.mockRequestFromFile('/api/issue_filters/app', 'app.json'); lib.mockRequestFromFile('/api/issues/search', 'search.json'); - lib.mockRequest('/issues/bulk_change_form?resolved=false', + lib.mockRequest('/issues/bulk_change_form*', '<div id="bulk-change-form">bulk change form</div>', { contentType: 'text/plain' }); }) @@ -335,9 +335,7 @@ casper.test.begin(testName('Bulk Change'), function (test) { }) .then(function () { - casper.waitForSelector('.issue', function () { - casper.waitForSelector('#issues-bulk-change'); - }); + casper.waitForSelector('#issues-bulk-change'); }) .then(function () { |