@osimatic/helpers-js 1.5.3 → 1.5.4

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.
@@ -85,17 +85,6 @@ describe('GoogleMap', () => {
85
85
  }
86
86
  };
87
87
 
88
- // Mock jQuery
89
- global.$ = jest.fn((selector) => {
90
- if (typeof selector === 'string') {
91
- if (selector.startsWith('#map')) {
92
- return { length: 1 };
93
- }
94
- return { length: 0 };
95
- }
96
- return { length: 0 };
97
- });
98
-
99
88
  // Mock document.getElementById
100
89
  document.getElementById = jest.fn((id) => {
101
90
  return { id: id };
@@ -108,12 +97,11 @@ describe('GoogleMap', () => {
108
97
  afterEach(() => {
109
98
  jest.clearAllMocks();
110
99
  delete global.google;
111
- delete global.$;
112
100
  });
113
101
 
114
102
  describe('constructor', () => {
115
103
  test('should return early when element does not exist', () => {
116
- global.$ = jest.fn(() => ({ length: 0 }));
104
+ document.getElementById = jest.fn(() => null);
117
105
 
118
106
  const googleMap = new GoogleMap('nonexistent');
119
107
 
@@ -149,10 +137,10 @@ describe('GoogleMap', () => {
149
137
  expect(mockMap.setZoom).toHaveBeenCalledWith(6);
150
138
  });
151
139
 
152
- test('should check if element exists with jQuery', () => {
140
+ test('should check if element exists via getElementById', () => {
153
141
  const googleMap = new GoogleMap('my-map');
154
142
 
155
- expect(global.$).toHaveBeenCalledWith('#my-map');
143
+ expect(document.getElementById).toHaveBeenCalledWith('my-map');
156
144
  });
157
145
  });
158
146