intl-tel-input 18.3.5 → 18.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,38 +8,26 @@ describe("useFullscreenPopup: testing fullscreen behavior can be controlled", fu
8
8
 
9
9
  afterEach(function() {
10
10
  intlTeardown();
11
- $('body').removeClass('iti-fullscreen-popup')
12
11
  });
13
12
 
14
- it("can enable fullscreen popup", function(){
13
+ it("can enable fullscreen popup", function() {
15
14
  iti = window.intlTelInput(input[0], {
16
15
  useFullscreenPopup: true,
17
16
  });
18
-
19
- expect($('body')).toHaveClass('iti-fullscreen-popup')
17
+ // no country list in markup initially
18
+ expect(getSelectedFlagContainer().find(".iti__country-list")).not.toExist();
19
+ getSelectedFlagContainer().click();
20
+ // after opening the dropdown, the dropdown container should be injected, with the right class, containing the country list
21
+ expect($('.iti--container')).toHaveClass('iti--fullscreen-popup');
22
+ expect($('.iti--container')).find(".iti__country-list").toExist();
20
23
  })
21
24
 
22
- it("can disable fullscreen popup", function(){
25
+ it("can disable fullscreen popup", function() {
23
26
  iti = window.intlTelInput(input[0], {
24
27
  useFullscreenPopup: false,
25
28
  });
26
-
27
- expect($('body')).not.toHaveClass('iti-fullscreen-popup')
28
- })
29
-
30
-
31
- it("can use default behavior: desktop", function(){
32
- iti = window.intlTelInput(input[0]);
33
-
34
- expect($('body')).not.toHaveClass('iti-fullscreen-popup')
35
- })
36
-
37
- // we would need to set the viewport width < 500 for this test to pass
38
- it.skip("can use default behavior: mobile", function(){
39
- spyOnProperty(window.navigator, 'userAgent').and.returnValue('iPhone');
40
-
41
- iti = window.intlTelInput(input[0]);
42
-
43
- expect($('body')).toHaveClass('iti-fullscreen-popup')
44
- })
45
- });
29
+ expect(getSelectedFlagContainer().find(".iti__country-list")).toExist();
30
+ getSelectedFlagContainer().click();
31
+ expect($('.iti--container')).not.toExist();
32
+ expect($('.iti--fullscreen-popup')).not.toExist();
33
+ })