@gitlab/ui 42.8.0 → 42.9.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitlab/ui",
3
- "version": "42.8.0",
3
+ "version": "42.9.0",
4
4
  "description": "GitLab UI Components",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -1,6 +1,6 @@
1
1
  import isFunction from 'lodash/isFunction';
2
2
 
3
- const DELAY_ON_HOVER = 100;
3
+ export const DELAY_ON_HOVER = 100;
4
4
  let mouseOverTimer;
5
5
  let mouseOverHandler;
6
6
 
@@ -1,5 +1,7 @@
1
1
  import { shallowMount } from '@vue/test-utils';
2
- import { HoverLoadDirective as hoverLoad } from './hover_load';
2
+ import { HoverLoadDirective as hoverLoad, DELAY_ON_HOVER } from './hover_load';
3
+
4
+ jest.useFakeTimers();
3
5
 
4
6
  describe('hover load directive', () => {
5
7
  let wrapper;
@@ -26,28 +28,25 @@ describe('hover load directive', () => {
26
28
  });
27
29
 
28
30
  it.each`
29
- hoverDuration | action
30
- ${150} | ${'triggers'}
31
- ${99} | ${'does not trigger'}
32
- `(
33
- 'if hover durations is $hoverDuration, directive $action the handler',
34
- async ({ hoverDuration }) => {
35
- const mockHandleLoad = jest.fn();
36
- createComponent(mockHandleLoad);
31
+ hoverDuration | action | expectedCalls
32
+ ${DELAY_ON_HOVER} | ${'triggers'} | ${1}
33
+ ${DELAY_ON_HOVER - 1} | ${'does not trigger'} | ${0}
34
+ `('$action the callback after $hoverDuration ms', ({ hoverDuration, expectedCalls }) => {
35
+ const mockHandleLoad = jest.fn();
36
+ createComponent(mockHandleLoad);
37
+
38
+ findTarget().trigger('mouseover');
39
+
40
+ jest.advanceTimersByTime(hoverDuration);
37
41
 
38
- findTarget().trigger('mouseover');
39
- await new Promise((resolve) => {
40
- setTimeout(resolve, hoverDuration);
41
- });
42
- findTarget().trigger('mouseout');
42
+ findTarget().trigger('mouseout');
43
43
 
44
- if (hoverDuration < 100) {
45
- expect(mockHandleLoad).not.toHaveBeenCalled();
46
- } else {
47
- expect(mockHandleLoad).toHaveBeenCalledTimes(1);
48
- }
44
+ expect(mockHandleLoad).toHaveBeenCalledTimes(expectedCalls);
45
+
46
+ if (expectedCalls) {
47
+ expect(mockHandleLoad).toHaveBeenCalledWith(findTarget().element);
49
48
  }
50
- );
49
+ });
51
50
 
52
51
  it('cleans up the mouseover event when component is destroyed', () => {
53
52
  createComponent(jest.fn());
@@ -3599,14 +3599,6 @@
3599
3599
  }
3600
3600
  }
3601
3601
 
3602
- .gl-grid-gap-6 {
3603
- gap: $gl-spacing-scale-6;
3604
- }
3605
-
3606
- .gl-grid-gap-6\! {
3607
- gap: $gl-spacing-scale-6 !important;
3608
- }
3609
-
3610
3602
  .gl-list-style-none {
3611
3603
  list-style-type: none
3612
3604
  }
@@ -6138,6 +6130,24 @@
6138
6130
  margin-left: #{$gl-spacing-scale-5} !important;
6139
6131
  }
6140
6132
  }
6133
+ .gl-gap-3 {
6134
+ gap: $gl-spacing-scale-3;
6135
+ }
6136
+ .gl-gap-3\! {
6137
+ gap: $gl-spacing-scale-3 !important;
6138
+ }
6139
+ .gl-gap-6 {
6140
+ gap: $gl-spacing-scale-6;
6141
+ }
6142
+ .gl-gap-6\! {
6143
+ gap: $gl-spacing-scale-6 !important;
6144
+ }
6145
+ .gl-grid-gap-6 {
6146
+ gap: $gl-spacing-scale-6;
6147
+ }
6148
+ .gl-grid-gap-6\! {
6149
+ gap: $gl-spacing-scale-6 !important;
6150
+ }
6141
6151
  .gl-xs-mb-3 {
6142
6152
  @include gl-media-breakpoint-down(sm) {
6143
6153
  margin-bottom: $gl-spacing-scale-3;
@@ -26,7 +26,3 @@
26
26
  grid-template-columns: 1fr 1fr;
27
27
  }
28
28
  }
29
-
30
- @mixin gl-grid-gap-6 {
31
- gap: $gl-spacing-scale-6;
32
- }
@@ -785,6 +785,19 @@
785
785
  }
786
786
  }
787
787
 
788
+ @mixin gl-gap-3 {
789
+ gap: $gl-spacing-scale-3;
790
+ }
791
+
792
+ @mixin gl-gap-6 {
793
+ gap: $gl-spacing-scale-6;
794
+ }
795
+
796
+ /* Deprecated */
797
+ @mixin gl-grid-gap-6 {
798
+ @include gl-gap-6;
799
+ }
800
+
788
801
  /**
789
802
  * Responsive margin utilities.
790
803
  *