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

  var features;

  beforeEach(function () {
    this.setupComponent();
    features = require('features');
  });

  it('is extra high when the logout button is present', function() {
    spyOn(features, 'isLogoutEnabled').and.returnValue(true);

    expect(this.$node.hasClass('extra-bottom-space')).toBe(true);
  });

  it('toggles when receiving a toggle event', function () {
    expect(this.$node.hasClass('hidden')).toBe(false);
    this.component.trigger(document, Pixelated.events.ui.userSettingsBox.toggle);
    expect(this.$node.hasClass('hidden')).toBe(true);
    this.component.trigger(document, Pixelated.events.ui.userSettingsBox.toggle);
    expect(this.$node.hasClass('hidden')).toBe(false);
  });

  it('hides iteslf when the right arrow is clicked', function () {
    this.$node.removeClass('hidden');
    this.component.select('close').click();

    expect(this.$node.hasClass('hidden')).toBe(true);
  });
});