aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/test/medium/computation.spec.js
blob: b6fa2c501fe810abd205e6cb93c5733c0202c40a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
define(function (require) {
  var bdd = require('intern!bdd');
  require('../helpers/test-page');

  bdd.describe('Computation Page', function () {
    bdd.it('should show list', function () {
      return this.remote
          .open()
          .mockFromFile('/api/computation/queue', 'computation-spec/queue.json')
          .mockFromFile('/api/computation/history', 'computation-spec/history.json')
          .startApp('computation/app')
          .checkElementCount('#computation-list li[data-id]', 1)
          .checkElementInclude('#computation-list', 'SonarQube')
          .checkElementInclude('#computation-list-footer', '1')
          .checkElementExist('.js-queue.selected')
          .clickElement('.js-history')
          .checkElementCount('#computation-list li[data-id]', 3)
          .checkElementInclude('#computation-list', 'Duration')
          .checkElementExist('.js-history.selected')
          .checkElementExist('.panel-danger[data-id="3"]')
          .clickElement('.js-queue')
          .checkElementCount('#computation-list li[data-id]', 1);
    });

    bdd.it('should show more', function () {
      return this.remote
          .open('#past')
          .mockFromFile('/api/computation/queue', 'computation-spec/queue.json')
          .mockFromFile('/api/computation/history', 'computation-spec/history-big-1.json')
          .startApp('computation/app')
          .checkElementCount('#computation-list li[data-id]', 2)
          .clearMocks()
          .mockFromFile('/api/computation/history', 'computation-spec/history-big-2.json', { data: { p: 2 } })
          .clickElement('#computation-fetch-more')
          .checkElementCount('#computation-list li[data-id]', 3);
    });
  });
});