summaryrefslogtreecommitdiff
path: root/web-ui/test/spec/page/logout.spec.js
blob: c614af6d332ca5ae7983676c04ef28bcd026ea6c (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
/*global Pixelated */

describeComponent('page/logout', function () {
  'use strict';

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

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

    it('should provide logout link if logout is enabled', function () {
      spyOn(features, 'isLogoutEnabled').andReturn(true);

      setupComponent('<div id="logout"></div>', {});

      var logout_link = this.component.$node.find('a')[0];
      expect(logout_link).toExist();
      expect(logout_link.href).toMatch('test/logout/url');
    });

    it('should not provide logout link if disabled', function() {
      spyOn(features, 'isLogoutEnabled').andReturn(false);

      setupComponent('<div id="logout"></div>', {});

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