Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 www 1
"use strict";
2
 
3
describe("close:countrydropdown event:", function() {
4
 
5
  var spy;
6
 
7
  beforeEach(function() {
8
    intlSetup();
9
    input = $("<input>").appendTo("body");
10
    spy = spyOnEvent(input, 'close:countrydropdown');
11
  });
12
 
13
  afterEach(function() {
14
    intlTeardown();
15
  });
16
 
17
  describe("init plugin", function() {
18
 
19
    beforeEach(function() {
20
      iti = window.intlTelInput(input[0])
21
    });
22
 
23
    it("does not trigger the event", function() {
24
      expect(spy).not.toHaveBeenTriggered();
25
    });
26
 
27
    it("clicking outside the dropdown to close it triggers the event", function() {
28
      openCountryDropDown();
29
      input[0].click();
30
      expect(spy).toHaveBeenTriggered();
31
    });
32
 
33
    it("pressing esc triggers the event", function() {
34
      openCountryDropDown();
35
      triggerKeyOnBody("Escape");
36
      expect(spy).toHaveBeenTriggered();
37
    });
38
 
39
    it("selecting another country triggers the event", function() {
40
      selectFlag("af");
41
      expect(spy).toHaveBeenTriggered();
42
    });
43
 
44
  });
45
 
46
});