fortitude-sass 0.6.5 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (128) hide show
  1. checksums.yaml +4 -4
  2. data/.editorconfig +12 -0
  3. data/.gitignore +3 -1
  4. data/.ruby-version +1 -1
  5. data/Gruntfile.js +73 -38
  6. data/app/assets/javascripts/fortitude/blocks/dropdown.js +44 -0
  7. data/app/assets/javascripts/fortitude/blocks/flashbar.js +24 -0
  8. data/app/assets/javascripts/fortitude/blocks/modal.js +50 -0
  9. data/app/assets/javascripts/fortitude/blocks/navigationbar.js +11 -0
  10. data/app/assets/javascripts/fortitude/blocks/select-input.js +38 -0
  11. data/app/assets/javascripts/fortitude/blocks/shade.js +28 -0
  12. data/app/assets/javascripts/fortitude/blocks/tabs.js +50 -0
  13. data/app/assets/javascripts/fortitude/generic/get-target.js +13 -0
  14. data/app/assets/javascripts/fortitude/generic/measure-scrollbar.js +21 -0
  15. data/app/assets/javascripts/fortitude/{jquery/generic → generic}/screen-lock.js +6 -2
  16. data/app/assets/javascripts/fortitude/generic/transition-with.js +57 -0
  17. data/app/assets/javascripts/fortitude/generic/viewport.js +21 -0
  18. data/app/assets/javascripts/fortitude/generic/wait-for-animation.js +27 -0
  19. data/app/assets/javascripts/fortitude.js +1 -0
  20. data/app/assets/stylesheets/fortitude/api/blocks/_badge.scss +1 -1
  21. data/app/assets/stylesheets/fortitude/api/blocks/_block-list.scss +2 -2
  22. data/app/assets/stylesheets/fortitude/api/blocks/_button.scss +1 -1
  23. data/app/assets/stylesheets/fortitude/api/blocks/_dropdown.scss +45 -0
  24. data/app/assets/stylesheets/fortitude/api/blocks/_flag.scss +2 -2
  25. data/app/assets/stylesheets/fortitude/api/blocks/_flashbar.scss +11 -1
  26. data/app/assets/stylesheets/fortitude/api/blocks/_input.scss +5 -2
  27. data/app/assets/stylesheets/fortitude/api/blocks/_layout.scss +2 -2
  28. data/app/assets/stylesheets/fortitude/api/blocks/_media.scss +2 -2
  29. data/app/assets/stylesheets/fortitude/api/blocks/_modal.scss +28 -0
  30. data/app/assets/stylesheets/fortitude/api/blocks/_navigationbar.scss +1 -0
  31. data/app/assets/stylesheets/fortitude/api/blocks/_shade.scss +11 -1
  32. data/app/assets/stylesheets/fortitude/api/blocks/_table.scss +5 -0
  33. data/app/assets/stylesheets/fortitude/api/blocks/_tabs-navigation.scss +3 -0
  34. data/app/assets/stylesheets/fortitude/api/blocks/_text.scss +3 -0
  35. data/app/assets/stylesheets/fortitude/api/blocks/_ui-list.scss +2 -2
  36. data/app/assets/stylesheets/fortitude/base/_hr.scss +2 -2
  37. data/app/assets/stylesheets/fortitude/base/_page.scss +0 -2
  38. data/app/assets/stylesheets/fortitude/blocks/_badge.scss +2 -0
  39. data/app/assets/stylesheets/fortitude/blocks/_bare-list.scss +2 -0
  40. data/app/assets/stylesheets/fortitude/blocks/_block-list.scss +2 -0
  41. data/app/assets/stylesheets/fortitude/blocks/_box.scss +2 -0
  42. data/app/assets/stylesheets/fortitude/blocks/_button.scss +2 -0
  43. data/app/assets/stylesheets/fortitude/blocks/_container.scss +2 -0
  44. data/app/assets/stylesheets/fortitude/blocks/_dropdown.scss +15 -0
  45. data/app/assets/stylesheets/fortitude/blocks/_flag.scss +2 -0
  46. data/app/assets/stylesheets/fortitude/blocks/_flashbar.scss +6 -0
  47. data/app/assets/stylesheets/fortitude/blocks/_fluid-container.scss +2 -0
  48. data/app/assets/stylesheets/fortitude/blocks/_inline-list.scss +2 -0
  49. data/app/assets/stylesheets/fortitude/blocks/_input.scss +2 -0
  50. data/app/assets/stylesheets/fortitude/blocks/_layout.scss +2 -0
  51. data/app/assets/stylesheets/fortitude/blocks/_list-navigation.scss +2 -0
  52. data/app/assets/stylesheets/fortitude/blocks/_media.scss +2 -0
  53. data/app/assets/stylesheets/fortitude/blocks/_modal.scss +8 -16
  54. data/app/assets/stylesheets/fortitude/blocks/_navigationbar.scss +5 -2
  55. data/app/assets/stylesheets/fortitude/blocks/_shade.scss +7 -0
  56. data/app/assets/stylesheets/fortitude/blocks/_table.scss +1 -6
  57. data/app/assets/stylesheets/fortitude/blocks/_tabs-navigation.scss +6 -0
  58. data/app/assets/stylesheets/fortitude/blocks/_tabs.scss +2 -0
  59. data/app/assets/stylesheets/fortitude/blocks/_text.scss +1 -3
  60. data/app/assets/stylesheets/fortitude/blocks/_tooltip.scss +2 -0
  61. data/app/assets/stylesheets/fortitude/blocks/_ui-list.scss +2 -0
  62. data/app/assets/stylesheets/fortitude/blocks/_wings.scss +3 -1
  63. data/app/assets/stylesheets/fortitude/generic/_normalize.scss +52 -15
  64. data/app/assets/stylesheets/fortitude/settings/_defaults.scss +1 -0
  65. data/app/assets/stylesheets/fortitude/theme/base/_page.scss +21 -0
  66. data/app/assets/stylesheets/fortitude/theme/extensions/_badge.scss +11 -0
  67. data/app/assets/stylesheets/fortitude/theme/extensions/_box.scss +11 -0
  68. data/app/assets/stylesheets/fortitude/theme/extensions/_button.scss +25 -0
  69. data/app/assets/stylesheets/fortitude/theme/extensions/_flashbar.scss +15 -0
  70. data/app/assets/stylesheets/fortitude/theme/extensions/_navigationbar.scss +51 -0
  71. data/app/assets/stylesheets/fortitude/theme/extensions/_wings.scss +15 -0
  72. data/app/assets/stylesheets/fortitude/theme/settings/_colors.scss +309 -0
  73. data/app/assets/stylesheets/fortitude/theme.scss +9 -0
  74. data/app/assets/stylesheets/fortitude/tools/_functions.scss +22 -13
  75. data/app/assets/stylesheets/fortitude/tools/_mixins.scss +10 -3
  76. data/app/assets/stylesheets/fortitude/trumps/_responsive-column.scss +1 -1
  77. data/app/assets/stylesheets/fortitude/trumps/_responsive-line-height.scss +1 -1
  78. data/app/assets/stylesheets/fortitude/trumps/_responsive-margin.scss +3 -3
  79. data/app/assets/stylesheets/fortitude/trumps/_responsive-padding.scss +1 -1
  80. data/app/assets/stylesheets/fortitude.scss +2 -0
  81. data/bower.json +1 -1
  82. data/jasmine/fixtures/animations.css +85 -0
  83. data/jasmine/fixtures/dropdownFixture.html +91 -0
  84. data/jasmine/fixtures/flashbarFixture.html +6 -0
  85. data/jasmine/fixtures/getTargetFixture.html +11 -0
  86. data/jasmine/fixtures/measureScrollBarFixture.html +1 -0
  87. data/jasmine/fixtures/modalFixture.html +20 -0
  88. data/jasmine/fixtures/navigationbarFixture.html +20 -0
  89. data/jasmine/fixtures/selectInputFixture.html +13 -0
  90. data/jasmine/fixtures/shadeFixture.html +2 -0
  91. data/jasmine/fixtures/tabsFixture.html +22 -0
  92. data/jasmine/fixtures/transitionWithFixture.html +6 -0
  93. data/jasmine/fixtures/viewportFixture.html +2 -0
  94. data/jasmine/fixtures/waitForAnimationFixture.html +1 -0
  95. data/jasmine/helpers/fixtureHelper.js +4 -0
  96. data/jasmine/helpers/multiCallbackHelper.js +24 -0
  97. data/jasmine/specs/blocks/dropdownSpec.js +106 -0
  98. data/jasmine/specs/blocks/flashbarSpec.js +22 -0
  99. data/jasmine/specs/blocks/modalSpec.js +66 -0
  100. data/jasmine/specs/blocks/navigationbarSpec.js +34 -0
  101. data/jasmine/specs/blocks/selectInputSpec.js +31 -0
  102. data/jasmine/specs/blocks/shadeSpec.js +38 -0
  103. data/jasmine/specs/blocks/tabsSpec.js +63 -0
  104. data/jasmine/specs/generic/getTargetSpec.js +28 -0
  105. data/jasmine/specs/generic/measureScrollbarSpec.js +19 -0
  106. data/jasmine/specs/generic/screenLockSpec.js +32 -0
  107. data/jasmine/specs/generic/transitionWithSpec.js +82 -0
  108. data/jasmine/specs/generic/viewportSpec.js +32 -0
  109. data/jasmine/specs/generic/waitForAnimationSpec.js +35 -0
  110. data/jasmine/template.tmpl +2 -0
  111. data/lib/fortitude-sass/version.rb +1 -1
  112. data/package.json +8 -2
  113. data/sass_specs/blocks/_shade_spec.scss +11 -0
  114. data/sass_specs/tests.scss +1 -0
  115. data/sass_specs/tools/_functions_spec.scss +42 -12
  116. metadata +59 -16
  117. data/app/assets/javascripts/fortitude/jquery/blocks/flashbar.js +0 -13
  118. data/app/assets/javascripts/fortitude/jquery/blocks/select-input.js +0 -26
  119. data/app/assets/javascripts/fortitude/jquery/blocks/shade.js +0 -36
  120. data/app/assets/javascripts/fortitude/jquery/generic/measure-scrollbar.js +0 -13
  121. data/app/assets/javascripts/fortitude/jquery/generic/viewport.js +0 -9
  122. data/app/assets/javascripts/fortitude/jquery/generic/wait-for-animation.js +0 -103
  123. data/app/assets/javascripts/fortitude/jquery/index.js +0 -3
  124. data/app/assets/javascripts/fortitude.jquery.js +0 -45
  125. data/dist/fortitude-theme.css +0 -9236
  126. data/dist/fortitude.css +0 -8976
  127. data/dist/fortitude.jquery.js +0 -1
  128. data/dist/fortitude.min.js +0 -1
@@ -0,0 +1,13 @@
1
+ <select class="select-input" id="select-with-placeholder">
2
+ <option class="placeholder" selected="true">
3
+ Placeholder option
4
+ </option>
5
+ <option value="2">Real option 1</option>
6
+ <option value="3">Real option 2</option>
7
+ </select>
8
+
9
+ <select class="select-input" id="select-without-placeholder">
10
+ <option >Placeholder option</option>
11
+ <option value="2">Real option 1</option>
12
+ <option value="3">Real option 2</option>
13
+ </select>
@@ -0,0 +1,2 @@
1
+ <div class="shade"></div>
2
+ <button type="button" data-ft-shade="true"></button>
@@ -0,0 +1,22 @@
1
+ <ul class="tabs-navigation">
2
+ <li class="tabs-navigation__item" data-ft-tab="tab-one">
3
+ <a href="javascript:void(0);" class="tabs-navigation__link">
4
+ Item 1
5
+ </a>
6
+ </li>
7
+ <li class="tabs-navigation__item" data-ft-tab="tab-two">
8
+ <a href="javascript:void(0);" class="tabs-navigation__link">
9
+ Item 2
10
+ </a>
11
+ </li>
12
+ </ul>
13
+
14
+ <div class="tabs">
15
+ <div class="tabs__target" id="tab-one">
16
+ Content for tab 1
17
+ </div>
18
+
19
+ <div class="tabs__target" id="tab-two">
20
+ Content for tab 2
21
+ </div>
22
+ </div>
@@ -0,0 +1,6 @@
1
+ <div id="transition"
2
+ class="animated showing transparent"
3
+ data-ft-show-class="grow"
4
+ data-ft-hide-class="fadeOut"></div>
5
+
6
+ <div id="no-transition"></div>
@@ -0,0 +1,2 @@
1
+ <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=7" />
2
+ <input type="text" />
@@ -0,0 +1 @@
1
+ <div id="animate" class="animated tiny"></div>
@@ -0,0 +1,4 @@
1
+ (function($){
2
+ 'use strict';
3
+ jasmine.getFixtures().fixturesPath = 'fixtures';
4
+ })(jQuery);
@@ -0,0 +1,24 @@
1
+ (function(_){
2
+ // 'use strict';
3
+
4
+ _.mixin({
5
+ multiCallback: function(elementArr){
6
+ var deferred = $.Deferred(),
7
+ finished = [];
8
+
9
+ _.forEach(elementArr, function(spec){
10
+ var eventName = spec[0],
11
+ $element = spec[1];
12
+
13
+ $element.on(eventName, function(){
14
+ finished.push([eventName, $element]);
15
+ if(finished.length === elementArr.length){
16
+ deferred.resolve(finished);
17
+ }
18
+ });
19
+ });
20
+
21
+ return deferred.promise();
22
+ }
23
+ });
24
+ })(_);
@@ -0,0 +1,106 @@
1
+ (function($){
2
+ 'use strict';
3
+
4
+ describe('.dropdown', function(){
5
+ var notChecked = '.dropdown__text:not(.dropdown__text--is-checked)',
6
+ checkNotVisible = function($dropdown){
7
+ expect($dropdown.find(notChecked)).toBeVisible();
8
+ expect($dropdown.find('.dropdown__text--is-checked')).not.toBeVisible();
9
+ expect($dropdown.find('.dropdown__navigation')).not.toBeVisible();
10
+ },
11
+ checkIsVisible = function($dropdown){
12
+ expect($dropdown.find(notChecked)).not.toBeVisible();
13
+ expect($dropdown.find('.dropdown__text--is-checked')).toBeVisible();
14
+ expect($dropdown.find('.dropdown__navigation')).toBeVisible();
15
+ },
16
+ checkDropdown = function($element){
17
+ $element.find('.dropdown__toggle').prop('checked', true).trigger('change');
18
+ },
19
+ $dropdowns;
20
+
21
+ beforeEach(function(){
22
+ loadFixtures('dropdownFixture.html');
23
+ $dropdowns = $('.dropdown');
24
+ });
25
+
26
+ it('is not open by default', function(){
27
+ checkNotVisible($dropdowns.eq(0));
28
+ });
29
+
30
+ it('becomes visible when checked', function(done){
31
+ var $dropdown = $dropdowns.eq(0);
32
+ checkDropdown($dropdown);
33
+
34
+ $dropdown.on('opened.ft.dropdown', function(){
35
+ checkIsVisible($dropdown);
36
+ $dropdowns.not($dropdowns.eq(0)).each(function(){
37
+ checkNotVisible($(this));
38
+ });
39
+ done();
40
+ });
41
+ });
42
+
43
+ it('hides dropdowns with the same data-ft-dropdown', function(done){
44
+ var $first = $dropdowns.eq(0),
45
+ $second = $dropdowns.eq(1);
46
+
47
+ checkDropdown($first);
48
+ $first.on('opened.ft.dropdown', function(){
49
+ checkDropdown($second);
50
+ });
51
+
52
+ $first.on('closed.ft.dropdown', function(){
53
+ checkNotVisible($first);
54
+ checkIsVisible($second);
55
+ done();
56
+ });
57
+ });
58
+
59
+ it('allows open dropdowns that do not have the same data-ft-dropdown', function(done){
60
+ var $first = $dropdowns.eq(0),
61
+ $second = $dropdowns.eq(2);
62
+
63
+ checkDropdown($first);
64
+ $first.on('opened.ft.dropdown', function(){
65
+ checkDropdown($second);
66
+ });
67
+
68
+ $second.on('opened.ft.dropdown', function(){
69
+ expect($first).not.toHaveClass('fadeOut');
70
+ checkIsVisible($second);
71
+ done();
72
+ });
73
+ });
74
+
75
+ it('hides fellow dropdowns, but not others', function(done){
76
+ var allFinished = [];
77
+
78
+ checkDropdown($dropdowns.eq(0));
79
+ checkDropdown($dropdowns.eq(2));
80
+ checkDropdown($dropdowns.eq(3));
81
+
82
+ // partner of 0
83
+ $dropdowns.eq(0).on('opened.ft.dropdown', function(){
84
+ checkDropdown($dropdowns.eq(1));
85
+ });
86
+
87
+ // partner of 3
88
+ $dropdowns.eq(3).on('opened.ft.dropdown', function(){
89
+ checkDropdown($dropdowns.eq(4));
90
+ });
91
+
92
+ _.multiCallback([
93
+ ['opened.ft.dropdown', $dropdowns.eq(2)],
94
+ ['closed.ft.dropdown', $dropdowns.eq(0)],
95
+ ['closed.ft.dropdown', $dropdowns.eq(3)]
96
+ ]).then(function(){
97
+ checkIsVisible($dropdowns.eq(1));
98
+ checkIsVisible($dropdowns.eq(2));
99
+ checkNotVisible($dropdowns.eq(0));
100
+ checkIsVisible($dropdowns.eq(4));
101
+ checkNotVisible($dropdowns.eq(3));
102
+ done();
103
+ });
104
+ });
105
+ });
106
+ })(jQuery);
@@ -0,0 +1,22 @@
1
+ (function($){
2
+ 'use strict';
3
+
4
+ describe(".flashbar", function(){
5
+ var $flashbar;
6
+
7
+ beforeEach(function(){
8
+ loadFixtures('flashbarFixture.html');
9
+ $flashbar = $('.flashbar');
10
+ });
11
+
12
+ it('removes flashbar when close is clicked', function(done){
13
+ $flashbar.find('.flashbar__close').trigger('click');
14
+ $flashbar.on('closed.ft.flashbar', function(){
15
+ expect($flashbar).toHaveClass('flashbar--closed');
16
+ expect($flashbar).not.toBeVisible();
17
+ done();
18
+ });
19
+ });
20
+ });
21
+
22
+ })(jQuery);
@@ -0,0 +1,66 @@
1
+ (function($){
2
+ 'use strict';
3
+
4
+ describe(".modal", function(){
5
+ var $modal, $animatedModal, $button, $animateButton, $shade, $closeButton;
6
+
7
+ beforeEach(function(){
8
+ loadFixtures('modalFixture.html');
9
+ $modal = $('#example-modal');
10
+ $button = $('button[data-ft-modal="example-modal"]');
11
+ $closeButton = $('button[data-ft-modal-close]');
12
+ $shade = $('.shade');
13
+ });
14
+
15
+ it('is not visible by default', function(){
16
+ expect($shade).not.toBeVisible();
17
+ expect($modal).not.toBeVisible();
18
+ });
19
+
20
+ it('shows modal on data-ft-modal click', function(done){
21
+ $button.trigger('click');
22
+ _.multiCallback([
23
+ ['opened.ft.shade', $shade],
24
+ ['opened.ft.modal', $modal]
25
+ ]).then(function(){
26
+ expect($shade).toBeVisible();
27
+ expect($modal).toBeVisible();
28
+ done();
29
+ });
30
+ });
31
+
32
+ it('hides modal on data-ft-modal-close click', function(done){
33
+ $modal.trigger('open.ft.modal');
34
+ $modal.on('opened.ft.modal', function(){
35
+ $closeButton.trigger('click');
36
+ });
37
+
38
+ _.multiCallback([
39
+ ['closed.ft.shade', $shade],
40
+ ['closed.ft.modal', $modal]
41
+ ]).then(function(){
42
+ expect($shade).not.toBeVisible();
43
+ expect($modal).not.toBeVisible();
44
+ done();
45
+ });
46
+
47
+ });
48
+
49
+ it('hides modal on .shade click', function(done){
50
+ $modal.trigger('open.ft.modal');
51
+ $modal.on('opened.ft.modal', function(){
52
+ $shade.trigger('click');
53
+ });
54
+
55
+ _.multiCallback([
56
+ ['closed.ft.shade', $shade],
57
+ ['closed.ft.modal', $modal]
58
+ ]).then(function(){
59
+ expect($shade).not.toBeVisible();
60
+ expect($modal).not.toBeVisible();
61
+ done();
62
+ });
63
+ });
64
+ });
65
+
66
+ })(jQuery);
@@ -0,0 +1,34 @@
1
+ (function($){
2
+ 'use strict';
3
+
4
+ describe(".navigationbar", function(){
5
+ var $navbar, $shade;
6
+
7
+ beforeEach(function(){
8
+ loadFixtures('navigationbarFixture.html');
9
+ $navbar = $('.navigationbar');
10
+ $shade = $('.shade');
11
+ });
12
+
13
+ it('does not have the shade open by default', function(){
14
+ expect($shade).not.toBeVisible();
15
+ });
16
+
17
+ it('opens the shade when toggle helper checked', function(done){
18
+ $navbar.find('.navigationbar__toggle__helper').trigger('click');
19
+ $shade.on('opened.ft.shade', function(){
20
+ expect($shade).toBeVisible();
21
+ done();
22
+ });
23
+ });
24
+
25
+ it('closes the shade when toggle helper unchecked', function(done){
26
+ $navbar.find('.navigationbar__toggle__helper').trigger('click');
27
+ $navbar.find('.navigationbar__toggle__helper').trigger('click');
28
+ $shade.on('closed.ft.shade', function(){
29
+ expect($shade).not.toBeVisible();
30
+ done();
31
+ });
32
+ });
33
+ });
34
+ })(jQuery);
@@ -0,0 +1,31 @@
1
+ (function($){
2
+ 'use strict';
3
+
4
+ describe('.select-input', function(){
5
+ var $select, $noPlaceholder;
6
+
7
+ beforeEach(function(){
8
+ loadFixtures('selectInputFixture.html');
9
+ $select = $('#select-with-placeholder');
10
+ $noPlaceholder = $('#select-without-placeholder');
11
+ $(document).trigger('setup.ft.select');
12
+ });
13
+
14
+ it('shows the default options class by default', function(){
15
+ expect($select).toHaveClass('select-input');
16
+ expect($select).toHaveClass('placeholder');
17
+ });
18
+
19
+ it('removes the class when the option changes', function(){
20
+ $select.val(2).trigger('change');
21
+ expect($select).toHaveClass('select-input');
22
+ expect($select).not.toHaveClass('placeholder');
23
+ });
24
+
25
+ it('does not set placeholders when no classes present', function(){
26
+ expect($noPlaceholder).not.toHaveClass('placeholder');
27
+ $noPlaceholder.val(2).trigger('change');
28
+ expect($noPlaceholder).not.toHaveClass('placeholder');
29
+ });
30
+ });
31
+ })(jQuery);
@@ -0,0 +1,38 @@
1
+ (function($){
2
+ 'use strict';
3
+
4
+ describe(".shade", function(){
5
+ var $shade;
6
+
7
+ beforeEach(function(){
8
+ loadFixtures('shadeFixture.html');
9
+ $shade = $('.shade');
10
+ });
11
+
12
+ it("is not immediately visible", function(){
13
+ expect($shade).not.toBeVisible();
14
+ });
15
+
16
+ it("is visible after event trigger", function(done){
17
+ $('[data-ft-shade]').trigger('click');
18
+ $shade.on('opened.ft.shade', function(){
19
+ expect($shade).toHaveClass('shade--is-active');
20
+ expect($shade).toBeVisible();
21
+ done();
22
+ });
23
+ });
24
+
25
+ it("closes when clicked on", function(done){
26
+ $shade.trigger('open.ft.shade');
27
+ $shade.on('opened.ft.shade', function(){
28
+ expect($shade).toHaveClass('shade--is-active');
29
+ $shade.trigger('click');
30
+ });
31
+
32
+ $shade.on('closed.ft.shade', function(){
33
+ expect($shade).not.toBeVisible();
34
+ done();
35
+ });
36
+ });
37
+ });
38
+ })(jQuery);
@@ -0,0 +1,63 @@
1
+ (function($){
2
+ 'use strict';
3
+
4
+ describe('.tabs-navigation and .tabs', function(){
5
+ var itemActive = 'tabs-navigation__item--is-active',
6
+ targetActive = 'tabs__target--is-active',
7
+ $itemOne, $itemTwo, $targetOne, $targetTwo;
8
+
9
+ beforeEach(function(){
10
+ loadFixtures('tabsFixture.html');
11
+ $itemOne = $('[data-ft-tab="tab-one"]');
12
+ $targetOne = $('#tab-one');
13
+
14
+ $itemTwo = $('[data-ft-tab="tab-two"]');
15
+ $targetTwo = $('#tab-two');
16
+ });
17
+
18
+ it('does not show tabs by default', function(){
19
+ expect($itemOne).not.toHaveClass(itemActive);
20
+ expect($itemTwo).not.toHaveClass(itemActive);
21
+ expect($targetOne).not.toBeVisible();
22
+ expect($targetTwo).not.toBeVisible();
23
+ });
24
+
25
+ it('shows tab one on click', function(done){
26
+ $itemOne.trigger('click');
27
+ _.multiCallback([
28
+ ['opened.ft.tab', $itemOne],
29
+ ['opened.ft.tabtarget', $targetOne]
30
+ ]).then(function(){
31
+ expect($itemOne).toHaveClass(itemActive);
32
+ expect($itemTwo).not.toHaveClass(itemActive);
33
+
34
+ expect($targetOne).toHaveClass(targetActive);
35
+ expect($targetOne).toBeVisible();
36
+
37
+ expect($targetTwo).not.toHaveClass(targetActive);
38
+ expect($targetTwo).not.toBeVisible();
39
+ done();
40
+ });
41
+ });
42
+
43
+ it('marks other tabs as inactive', function(done){
44
+ $itemOne.trigger('select.ft.tab');
45
+ $itemTwo.trigger('select.ft.tab');
46
+
47
+ _.multiCallback([
48
+ ['opened.ft.tab', $itemTwo],
49
+ ['opened.ft.tabtarget', $targetTwo]
50
+ ]).then(function(){
51
+ expect($itemOne).not.toHaveClass(itemActive);
52
+ expect($itemTwo).toHaveClass(itemActive);
53
+
54
+ expect($targetOne).not.toHaveClass(targetActive);
55
+ expect($targetOne).not.toBeVisible();
56
+
57
+ expect($targetTwo).toHaveClass(targetActive);
58
+ expect($targetTwo).toBeVisible();
59
+ done();
60
+ });
61
+ });
62
+ });
63
+ })(jQuery);