summaryrefslogtreecommitdiff
path: root/web-ui/test/spec/user_alerts/ui/user_alerts.spec.js
blob: 42ef581c264fd3205b8e4773fc485f3c8416f193 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
describeComponent('user_alerts/ui/user_alerts', function () {
  'use strict';

  beforeEach(function () {
    setupComponent('<div id="userAlerts"></div>', { dismissTimeout: 100 });
  });

  it('should render message when ui:user_alerts:displayMessage is triggered', function () {
    this.component.trigger(Pixelated.events.ui.userAlerts.displayMessage, { message: 'a message' });

    expect(this.component.$node.html()).toMatch('a message');
  });

  it('should be emptied and hidden when hide is called', function() {
    expect(this.$node).not.toBeHidden();
    this.component.hide()
    expect(this.$node).toBeHidden();
    expect(this.$node.html()).toEqual('')
  });



});