summaryrefslogtreecommitdiff
path: root/web-ui/test/spec/page/logout_shortcut.spec.js
blob: 9882b343bc8f1890687f21cbb9bd7742c31f2ba3 (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
describeComponent('page/logout_shortcut', function () {
  'use strict';

  describe('logout icon', function () {
    var features;

    beforeEach(function() {
      features = require('features');
    });

    it('should provide logout icon if logout is enabled', function () {
      spyOn(features, 'isLogoutEnabled').and.returnValue(true);

      this.setupComponent('<ul id="logout-shortcut" class="shortcuts">, {}');

      var logout_icon = this.component.$node.find('a')[0];
      expect(logout_icon).toExist();
      expect(logout_icon.innerHTML).toContain('i class="fa fa-sign-out"></i>');
      //expect(logout_icon.innerHTML).toContain('foobar')
    });

    it('should not provide logout icon if logout is disabled', function () {
      spyOn(features, 'isLogoutEnabled').and.returnValue(false);

      this.setupComponent('<ul id="logout-shortcut" class="shortcuts">, {}');

      var logout_icon = this.component.$node.find('a')[0];
      expect(logout_icon).not.toExist();
    });
  });
});