@pequity/squirrel 11.0.1 → 11.0.3

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.
Files changed (32) hide show
  1. package/dist/cjs/chunks/index.js +374 -216
  2. package/dist/cjs/chunks/p-btn.js +1 -1
  3. package/dist/cjs/dateLocale.js +1221 -280
  4. package/dist/cjs/index.js +19 -8
  5. package/dist/cjs/inputClasses.js +3 -3
  6. package/dist/es/chunks/index.js +374 -216
  7. package/dist/es/chunks/p-btn.js +2 -2
  8. package/dist/es/dateLocale.js +1221 -280
  9. package/dist/es/index.js +48 -37
  10. package/dist/es/inputClasses.js +4 -4
  11. package/dist/squirrel/components/p-link/p-link.vue.d.ts +2 -2
  12. package/dist/squirrel/components/p-pagination-info/p-pagination-info.vue.d.ts +2 -2
  13. package/dist/squirrel/components/p-table/p-table.vue.d.ts +3 -1
  14. package/dist/squirrel/components/p-table-header-cell/p-table-header-cell.vue.d.ts +2 -2
  15. package/package.json +31 -31
  16. package/squirrel/components/p-btn/p-btn.spec.js +15 -5
  17. package/squirrel/components/p-drawer/p-drawer.spec.js +16 -11
  18. package/squirrel/components/p-dropdown/p-dropdown.spec.js +15 -10
  19. package/squirrel/components/p-dropdown-select/p-dropdown-select.spec.js +44 -27
  20. package/squirrel/components/p-pagination/p-pagination.spec.js +22 -30
  21. package/squirrel/components/p-select-btn/p-select-btn.spec.js +35 -27
  22. package/squirrel/components/p-select-list/p-select-list.spec.js +44 -27
  23. package/squirrel/components/p-select-pill/p-select-pill.spec.js +7 -6
  24. package/squirrel/components/p-table/p-table.spec.js +50 -43
  25. package/squirrel/components/p-tabs-pills/p-tabs-pills.spec.js +10 -8
  26. package/squirrel/locales/de-DE.json +47 -0
  27. package/squirrel/locales/es-ES.json +47 -0
  28. package/squirrel/plugin/index.spec.ts +32 -12
  29. package/squirrel/plugin/index.ts +6 -2
  30. package/squirrel/utils/dateLocale.spec.ts +9 -5
  31. package/squirrel/utils/dateLocale.ts +7 -3
  32. /package/squirrel/locales/{fr-CA.json → fr-FR.json} +0 -0
@@ -595,11 +595,11 @@ describe('PDropdownSelect.vue', () => {
595
595
 
596
596
  const items = wrapper.findAll('[p-select-list-option-item]');
597
597
 
598
- items.forEach((item) => {
599
- if (item.text() !== '') {
600
- expect(item.text().includes('44')).toBe(true);
601
- expect(item.classes()).toContain('selected');
602
- }
598
+ // Filter out empty items and check them separately
599
+ const nonEmptyItems = items.filter((item) => item.text() !== '');
600
+ nonEmptyItems.forEach((item) => {
601
+ expect(item.text().includes('44')).toBe(true);
602
+ expect(item.classes()).toContain('selected');
603
603
  });
604
604
 
605
605
  await wrapper.findByText('ff-a57d-beba44884da2').trigger('click');
@@ -608,13 +608,22 @@ describe('PDropdownSelect.vue', () => {
608
608
 
609
609
  const newItems = wrapper.findAll('[p-select-list-option-item]');
610
610
 
611
- newItems.forEach((item) => {
611
+ // Split items into those with images and those without
612
+ const selectedItemTexts = ['4d68f93b-ec71-4f02-a1a2-ffb5d87be9f1', 'de5c4b8b-80e1-4475-aa8f-3e0fd0f9ddd7'];
613
+ const itemsWithImages = newItems.filter((item) => {
612
614
  const itemText = item.find('.truncate.text-p-purple-60').text();
613
- if (itemText === '4d68f93b-ec71-4f02-a1a2-ffb5d87be9f1' || itemText === 'de5c4b8b-80e1-4475-aa8f-3e0fd0f9ddd7') {
614
- expect(item.find('img').exists()).toBe(true);
615
- } else {
616
- expect(item.find('img').exists()).toBe(false);
617
- }
615
+ return selectedItemTexts.includes(itemText);
616
+ });
617
+ const itemsWithoutImages = newItems.filter((item) => {
618
+ const itemText = item.find('.truncate.text-p-purple-60').text();
619
+ return !selectedItemTexts.includes(itemText);
620
+ });
621
+
622
+ itemsWithImages.forEach((item) => {
623
+ expect(item.find('img').exists()).toBe(true);
624
+ });
625
+ itemsWithoutImages.forEach((item) => {
626
+ expect(item.find('img').exists()).toBe(false);
618
627
  });
619
628
 
620
629
  expect(wrapper.vm.$data.selected).toEqual([1, 3]);
@@ -636,14 +645,18 @@ describe('PDropdownSelect.vue', () => {
636
645
 
637
646
  const listItems = wrapper.findAll('[p-select-list-option-item]');
638
647
 
639
- listItems.forEach((item, i) => {
640
- if (i === 0 || i === 1) {
641
- expect(item.classes()).not.toContain('cursor-pointer');
642
- expect(item.classes()).toContain('cursor-default');
643
- } else {
644
- expect(item.classes()).toContain('cursor-pointer');
645
- expect(item.classes()).not.toContain('cursor-default');
646
- }
648
+ // Test disabled items (indices 0 and 1)
649
+ const disabledItems = [listItems[0], listItems[1]];
650
+ disabledItems.forEach((item) => {
651
+ expect(item.classes()).not.toContain('cursor-pointer');
652
+ expect(item.classes()).toContain('cursor-default');
653
+ });
654
+
655
+ // Test enabled items (rest of the items)
656
+ const enabledItems = listItems.slice(2);
657
+ enabledItems.forEach((item) => {
658
+ expect(item.classes()).toContain('cursor-pointer');
659
+ expect(item.classes()).not.toContain('cursor-default');
647
660
  });
648
661
 
649
662
  cleanup(wrapper);
@@ -664,14 +677,18 @@ describe('PDropdownSelect.vue', () => {
664
677
 
665
678
  const listItems = wrapper.findAll('[p-select-list-option-item]');
666
679
 
667
- listItems.forEach((item, i) => {
668
- if (i === 0 || i === 1) {
669
- expect(item.classes()).toContain('cursor-default');
670
- expect(item.classes()).not.toContain('cursor-pointer');
671
- } else {
672
- expect(item.classes()).toContain('cursor-pointer');
673
- expect(item.classes()).not.toContain('cursor-default');
674
- }
680
+ // Test disabled items (indices 0 and 1) based on disabledBy prop
681
+ const disabledItems = [listItems[0], listItems[1]];
682
+ disabledItems.forEach((item) => {
683
+ expect(item.classes()).toContain('cursor-default');
684
+ expect(item.classes()).not.toContain('cursor-pointer');
685
+ });
686
+
687
+ // Test enabled items (rest of the items)
688
+ const enabledItems = listItems.slice(2);
689
+ enabledItems.forEach((item) => {
690
+ expect(item.classes()).toContain('cursor-pointer');
691
+ expect(item.classes()).not.toContain('cursor-default');
675
692
  });
676
693
 
677
694
  cleanup(wrapper);
@@ -12,37 +12,29 @@ describe('PPagination.vue', () => {
12
12
 
13
13
  const controls = await wrapper.findAll('div.w-6.h-6');
14
14
 
15
- controls.forEach((control, i) => {
16
- if (i === 0) {
17
- expect(control.classes()).toContain('opacity-50');
18
- expect(control.attributes()['aria-label']).toBe('go to the previous page');
19
- }
20
- if (i === 1) {
21
- expect(control.text()).toBe('1');
22
- expect(control.attributes()['aria-label']).toBe('go to page 1');
23
- }
24
- if (i === 2) {
25
- expect(control.text()).toBe('2');
26
- expect(control.attributes()['aria-label']).toBe('go to page 2');
27
- }
28
- if (i === 3) {
29
- expect(control.text()).toBe('3');
30
- expect(control.attributes()['aria-label']).toBe('go to page 3');
31
- }
32
- if (i === 4) {
33
- expect(control.text()).toBe('...');
34
- expect(control.attributes()['aria-label']).toBe(undefined);
35
- }
36
- if (i === 5) {
37
- expect(control.text()).toBe('5');
38
- expect(control.attributes()['aria-label']).toBe('go to page 5');
39
- }
40
- if (i === 6) {
41
- expect(control.classes()).toContain('cursor-pointer');
42
- expect(control.attributes()['aria-label']).toBe('go to the next page');
43
- }
44
- });
45
15
  expect(controls.length).toBe(7);
16
+
17
+ // Test each control directly by index to avoid conditional expects
18
+ expect(controls[0].classes()).toContain('opacity-50');
19
+ expect(controls[0].attributes()['aria-label']).toBe('go to the previous page');
20
+
21
+ expect(controls[1].text()).toBe('1');
22
+ expect(controls[1].attributes()['aria-label']).toBe('go to page 1');
23
+
24
+ expect(controls[2].text()).toBe('2');
25
+ expect(controls[2].attributes()['aria-label']).toBe('go to page 2');
26
+
27
+ expect(controls[3].text()).toBe('3');
28
+ expect(controls[3].attributes()['aria-label']).toBe('go to page 3');
29
+
30
+ expect(controls[4].text()).toBe('...');
31
+ expect(controls[4].attributes()['aria-label']).toBe(undefined);
32
+
33
+ expect(controls[5].text()).toBe('5');
34
+ expect(controls[5].attributes()['aria-label']).toBe('go to page 5');
35
+
36
+ expect(controls[6].classes()).toContain('cursor-pointer');
37
+ expect(controls[6].attributes()['aria-label']).toBe('go to the next page');
46
38
  });
47
39
 
48
40
  it(`updates the value bound with v-model`, async () => {
@@ -153,26 +153,28 @@ describe('PSelectBtn.vue', () => {
153
153
 
154
154
  const buttons = await wrapper.findAll('button');
155
155
 
156
- buttons.forEach((button, i) => {
157
- if (i !== 0 && i !== items.length - 1) {
158
- expect(['rounded-none'].every((c) => button.classes().includes(c))).toBe(true);
159
- }
160
- if (i === 0) {
161
- expect(['rounded-br-none', 'rounded-tr-none'].every((c) => button.classes().includes(c))).toBe(true);
162
- }
163
- if (i === items.length - 1) {
164
- expect(['rounded-bl-none', 'rounded-tl-none'].every((c) => button.classes().includes(c))).toBe(true);
165
- }
166
- if (i !== items.length - 1) {
167
- expect(button.classes()).toContain('-mr-0.5');
168
- }
169
-
170
- // Check highlightSelected prop
171
- if (button.text() === 'Option 2') {
172
- expect(button.attributes()['aria-selected']).toBe('true');
173
- } else {
174
- expect(button.attributes()['aria-selected']).toBe('false');
175
- }
156
+ // Test first button (index 0)
157
+ expect(['rounded-br-none', 'rounded-tr-none'].every((c) => buttons[0].classes().includes(c))).toBe(true);
158
+ expect(buttons[0].classes()).toContain('-mr-0.5');
159
+
160
+ // Test middle buttons (not first, not last)
161
+ const middleButtons = buttons.slice(1, items.length - 1);
162
+ middleButtons.forEach((button) => {
163
+ expect(['rounded-none'].every((c) => button.classes().includes(c))).toBe(true);
164
+ expect(button.classes()).toContain('-mr-0.5');
165
+ });
166
+
167
+ // Test last button
168
+ const lastButton = buttons[items.length - 1];
169
+ expect(['rounded-bl-none', 'rounded-tl-none'].every((c) => lastButton.classes().includes(c))).toBe(true);
170
+
171
+ // Check highlightSelected prop - split into selected and non-selected buttons
172
+ const selectedButton = buttons.find((button) => button.text() === 'Option 2');
173
+ const nonSelectedButtons = buttons.filter((button) => button.text() !== 'Option 2');
174
+
175
+ expect(selectedButton.attributes()['aria-selected']).toBe('true');
176
+ nonSelectedButtons.forEach((button) => {
177
+ expect(button.attributes()['aria-selected']).toBe('false');
176
178
  });
177
179
  });
178
180
 
@@ -268,17 +270,23 @@ describe('PSelectBtn.vue', () => {
268
270
 
269
271
  const buttons = await wrapper.findAll('button');
270
272
 
273
+ // Test button text for all buttons
271
274
  buttons.forEach((button, i) => {
272
275
  const slotContent = button.text().split(' - ');
273
276
  const btnText = slotContent[0];
274
- const isSelected = slotContent[1];
275
-
276
277
  expect(btnText).toBe(items[i].textCustom);
277
- if (i === 1) {
278
- expect(isSelected).toBe('true');
279
- } else {
280
- expect(isSelected).toBe('false');
281
- }
278
+ });
279
+
280
+ // Test isSelected for the selected button (index 1)
281
+ const selectedButtonSlot = buttons[1].text().split(' - ');
282
+ expect(selectedButtonSlot[1]).toBe('true');
283
+
284
+ // Test isSelected for non-selected buttons
285
+ const nonSelectedButtons = buttons.filter((_, i) => i !== 1);
286
+ nonSelectedButtons.forEach((button) => {
287
+ const slotContent = button.text().split(' - ');
288
+ const isSelected = slotContent[1];
289
+ expect(isSelected).toBe('false');
282
290
  });
283
291
 
284
292
  expect(true).toBe(true);
@@ -476,11 +476,11 @@ describe('PSelectList.vue', () => {
476
476
 
477
477
  const items = wrapper.findAll('[p-select-list-option-item]');
478
478
 
479
- items.forEach((item) => {
480
- if (item.text() !== '') {
481
- expect(item.text().includes('44')).toBe(true);
482
- expect(item.classes()).toContain('selected');
483
- }
479
+ // Filter out empty items and check them separately
480
+ const nonEmptyItems = items.filter((item) => item.text() !== '');
481
+ nonEmptyItems.forEach((item) => {
482
+ expect(item.text().includes('44')).toBe(true);
483
+ expect(item.classes()).toContain('selected');
484
484
  });
485
485
 
486
486
  await wrapper.findByText('ff-a57d-beba44884da2').trigger('click');
@@ -489,13 +489,22 @@ describe('PSelectList.vue', () => {
489
489
 
490
490
  const newItems = wrapper.findAll('[p-select-list-option-item]');
491
491
 
492
- newItems.forEach((item) => {
492
+ // Split items into those with images and those without
493
+ const selectedItemTexts = ['4d68f93b-ec71-4f02-a1a2-ffb5d87be9f1', 'de5c4b8b-80e1-4475-aa8f-3e0fd0f9ddd7'];
494
+ const itemsWithImages = newItems.filter((item) => {
493
495
  const itemText = item.find('.truncate.text-p-purple-60').text();
494
- if (itemText === '4d68f93b-ec71-4f02-a1a2-ffb5d87be9f1' || itemText === 'de5c4b8b-80e1-4475-aa8f-3e0fd0f9ddd7') {
495
- expect(item.find('img').exists()).toBe(true);
496
- } else {
497
- expect(item.find('img').exists()).toBe(false);
498
- }
496
+ return selectedItemTexts.includes(itemText);
497
+ });
498
+ const itemsWithoutImages = newItems.filter((item) => {
499
+ const itemText = item.find('.truncate.text-p-purple-60').text();
500
+ return !selectedItemTexts.includes(itemText);
501
+ });
502
+
503
+ itemsWithImages.forEach((item) => {
504
+ expect(item.find('img').exists()).toBe(true);
505
+ });
506
+ itemsWithoutImages.forEach((item) => {
507
+ expect(item.find('img').exists()).toBe(false);
499
508
  });
500
509
 
501
510
  expect(wrapper.vm.$data.selected).toEqual([1, 3]);
@@ -543,14 +552,18 @@ describe('PSelectList.vue', () => {
543
552
 
544
553
  const listItems = wrapper.findAll('[p-select-list-option-item]');
545
554
 
546
- listItems.forEach((item, i) => {
547
- if (i === 0 || i === 1) {
548
- expect(item.classes()).toContain('cursor-default');
549
- expect(item.classes()).not.toContain('cursor-pointer');
550
- } else {
551
- expect(item.classes()).toContain('cursor-pointer');
552
- expect(item.classes()).not.toContain('cursor-default');
553
- }
555
+ // Test disabled items (indices 0 and 1)
556
+ const disabledItems = [listItems[0], listItems[1]];
557
+ disabledItems.forEach((item) => {
558
+ expect(item.classes()).toContain('cursor-default');
559
+ expect(item.classes()).not.toContain('cursor-pointer');
560
+ });
561
+
562
+ // Test enabled items (rest of the items)
563
+ const enabledItems = listItems.slice(2);
564
+ enabledItems.forEach((item) => {
565
+ expect(item.classes()).toContain('cursor-pointer');
566
+ expect(item.classes()).not.toContain('cursor-default');
554
567
  });
555
568
 
556
569
  cleanup(wrapper);
@@ -567,14 +580,18 @@ describe('PSelectList.vue', () => {
567
580
 
568
581
  const listItems = wrapper.findAll('[p-select-list-option-item]');
569
582
 
570
- listItems.forEach((item, i) => {
571
- if (i === 0 || i === 1) {
572
- expect(item.classes()).toContain('cursor-default');
573
- expect(item.classes()).not.toContain('cursor-pointer');
574
- } else {
575
- expect(item.classes()).toContain('cursor-pointer');
576
- expect(item.classes()).not.toContain('cursor-default');
577
- }
583
+ // Test disabled items (indices 0 and 1) based on disabledBy prop
584
+ const disabledItems = [listItems[0], listItems[1]];
585
+ disabledItems.forEach((item) => {
586
+ expect(item.classes()).toContain('cursor-default');
587
+ expect(item.classes()).not.toContain('cursor-pointer');
588
+ });
589
+
590
+ // Test enabled items (rest of the items)
591
+ const enabledItems = listItems.slice(2);
592
+ enabledItems.forEach((item) => {
593
+ expect(item.classes()).toContain('cursor-pointer');
594
+ expect(item.classes()).not.toContain('cursor-default');
578
595
  });
579
596
 
580
597
  cleanup(wrapper);
@@ -219,12 +219,13 @@ describe('PSelectPill.vue', () => {
219
219
  // Test mounted lifecycle
220
220
  expect(wrapper.vm.$refs.pill).toBeDefined();
221
221
 
222
- // Test that pill ref exists and style can be set
223
- if (wrapper.vm.$refs.pill instanceof HTMLElement) {
224
- wrapper.vm.setPillStyle();
225
- expect(wrapper.vm.$refs.pill.style.left).toBeDefined();
226
- expect(wrapper.vm.$refs.pill.style.width).toBeDefined();
227
- }
222
+ // Test that pill ref exists and is an HTMLElement
223
+ expect(wrapper.vm.$refs.pill instanceof HTMLElement).toBe(true);
224
+
225
+ // Test that style can be set
226
+ wrapper.vm.setPillStyle();
227
+ expect(wrapper.vm.$refs.pill.style.left).toBeDefined();
228
+ expect(wrapper.vm.$refs.pill.style.width).toBeDefined();
228
229
 
229
230
  wrapper.unmount();
230
231
  });
@@ -79,7 +79,6 @@ describe('PTable.vue', () => {
79
79
 
80
80
  cols.forEach((col) => {
81
81
  const th = wrapper.find(`th[data-col-id="${col.id}"]`);
82
- const containerDiv = th.find('div.relative');
83
82
  const headerCell = th.find('div.header-cell-stub');
84
83
  const showFilterIcon = col.filterable || col.sortable;
85
84
 
@@ -90,12 +89,15 @@ describe('PTable.vue', () => {
90
89
  expect(headerCell.classes()).toContain('header-cell-class');
91
90
  expect(headerCell.attributes()['filter-active']).toBe(col.filterActive.toString());
92
91
  expect(headerCell.attributes()['show-filter-icon']).toBe(showFilterIcon.toString());
92
+ });
93
93
 
94
- if (!col.borderColor) {
95
- ['border-b', 'border-p-gray-30'].forEach((className) => {
96
- expect(containerDiv.classes()).toContain(className);
97
- });
98
- }
94
+ // Check border classes only for columns without custom borderColor
95
+ const colsWithoutBorder = cols.filter((col) => !col.borderColor);
96
+ colsWithoutBorder.forEach((col) => {
97
+ const th = wrapper.find(`th[data-col-id="${col.id}"]`);
98
+ const containerDiv = th.find('div.relative');
99
+ expect(containerDiv.classes()).toContain('border-b');
100
+ expect(containerDiv.classes()).toContain('border-p-gray-30');
99
101
  });
100
102
 
101
103
  data.forEach((row, i) => {
@@ -132,7 +134,6 @@ describe('PTable.vue', () => {
132
134
 
133
135
  cols.forEach((col) => {
134
136
  const th = wrapper.find(`th[data-col-id="${col.id}"]`);
135
- const containerDiv = th.find('div.relative');
136
137
  const headerCell = th.find('div.header-cell-stub');
137
138
  const showFilterIcon = col.filterable || col.sortable;
138
139
 
@@ -143,12 +144,15 @@ describe('PTable.vue', () => {
143
144
  expect(headerCell.classes()).toContain('header-cell-class');
144
145
  expect(headerCell.attributes()['filter-active']).toBe(col.filterActive.toString());
145
146
  expect(headerCell.attributes()['show-filter-icon']).toBe(showFilterIcon.toString());
147
+ });
146
148
 
147
- if (!col.borderColor) {
148
- ['border-b', 'border-p-gray-30'].forEach((className) => {
149
- expect(containerDiv.classes()).toContain(className);
150
- });
151
- }
149
+ // Check border classes only for columns without custom borderColor
150
+ const colsWithoutBorder = cols.filter((col) => !col.borderColor);
151
+ colsWithoutBorder.forEach((col) => {
152
+ const th = wrapper.find(`th[data-col-id="${col.id}"]`);
153
+ const containerDiv = th.find('div.relative');
154
+ expect(containerDiv.classes()).toContain('border-b');
155
+ expect(containerDiv.classes()).toContain('border-p-gray-30');
152
156
  });
153
157
 
154
158
  data.forEach((row, i) => {
@@ -185,7 +189,6 @@ describe('PTable.vue', () => {
185
189
 
186
190
  cols.forEach((col) => {
187
191
  const th = wrapper.find(`th[data-col-id="${col.id}"]`);
188
- const containerDiv = th.find('div.relative');
189
192
  const headerCell = th.find('div.header-cell-stub');
190
193
  const showFilterIcon = col.filterable || col.sortable;
191
194
 
@@ -196,12 +199,15 @@ describe('PTable.vue', () => {
196
199
  expect(headerCell.classes()).toContain('header-cell-class');
197
200
  expect(headerCell.attributes()['filter-active']).toBe(col.filterActive.toString());
198
201
  expect(headerCell.attributes()['show-filter-icon']).toBe(showFilterIcon.toString());
202
+ });
199
203
 
200
- if (!col.borderColor) {
201
- ['border-b', 'border-p-gray-30'].forEach((className) => {
202
- expect(containerDiv.classes()).toContain(className);
203
- });
204
- }
204
+ // Check border classes only for columns without custom borderColor
205
+ const colsWithoutBorder = cols.filter((col) => !col.borderColor);
206
+ colsWithoutBorder.forEach((col) => {
207
+ const th = wrapper.find(`th[data-col-id="${col.id}"]`);
208
+ const containerDiv = th.find('div.relative');
209
+ expect(containerDiv.classes()).toContain('border-b');
210
+ expect(containerDiv.classes()).toContain('border-p-gray-30');
205
211
  });
206
212
 
207
213
  data.forEach((row, i) => {
@@ -212,12 +218,13 @@ describe('PTable.vue', () => {
212
218
 
213
219
  cols.forEach((col, j) => {
214
220
  const innerDiv = tds[j].find('div');
215
- if (col.name === 'Third column') {
216
- expect(innerDiv.text()).toBe('Constant Cell Content');
217
- } else {
218
- expect(innerDiv.text()).toBe(row[col.name]);
219
- expect(innerDiv.classes()).toContain('py-2');
220
- }
221
+ const isThirdColumn = col.name === 'Third column';
222
+ const expectedText = isThirdColumn ? 'Constant Cell Content' : row[col.name];
223
+ expect(innerDiv.text()).toBe(expectedText);
224
+
225
+ // Only check py-2 class for non-third-column cells
226
+ const hasPy2Class = innerDiv.classes().includes('py-2');
227
+ expect(hasPy2Class).toBe(!isThirdColumn);
221
228
  });
222
229
  });
223
230
  });
@@ -242,7 +249,6 @@ describe('PTable.vue', () => {
242
249
 
243
250
  cols.forEach((col) => {
244
251
  const th = wrapper.find(`th[data-col-id="${col.id}"]`);
245
- const containerDiv = th.find('div.relative');
246
252
  const headerCell = th.find('div.header-cell-stub');
247
253
  const showFilterIcon = col.filterable || col.sortable;
248
254
 
@@ -254,15 +260,18 @@ describe('PTable.vue', () => {
254
260
  expect(headerCell.attributes()['filter-active']).toBe(col.filterActive.toString());
255
261
  expect(headerCell.attributes()['show-filter-icon']).toBe(showFilterIcon.toString());
256
262
 
257
- if (col.name === 'Second column') {
258
- expect(th.find('div.prepend').exists()).toBe(true);
259
- }
263
+ // Check prepend div for second column
264
+ const isSecondColumn = col.name === 'Second column';
265
+ expect(th.find('div.prepend').exists()).toBe(isSecondColumn);
266
+ });
260
267
 
261
- if (!col.borderColor) {
262
- ['border-b', 'border-p-gray-30'].forEach((className) => {
263
- expect(containerDiv.classes()).toContain(className);
264
- });
265
- }
268
+ // Check border classes only for columns without custom borderColor
269
+ const colsWithoutBorder = cols.filter((col) => !col.borderColor);
270
+ colsWithoutBorder.forEach((col) => {
271
+ const th = wrapper.find(`th[data-col-id="${col.id}"]`);
272
+ const containerDiv = th.find('div.relative');
273
+ expect(containerDiv.classes()).toContain('border-b');
274
+ expect(containerDiv.classes()).toContain('border-p-gray-30');
266
275
  });
267
276
  });
268
277
 
@@ -276,13 +285,12 @@ describe('PTable.vue', () => {
276
285
  const th = wrapper.find(`th[data-col-id="${col.id}"]`);
277
286
  const containerDiv = th.find('div.relative');
278
287
 
279
- if (i === 0 || i === cols.length - 1) {
280
- ['th-shadow', 'px-4'].forEach((className) => {
281
- expect(containerDiv.classes()).toContain(className);
282
- });
283
- } else {
284
- expect(containerDiv.classes()).toContain('px-2');
285
- }
288
+ const isFirstOrLast = i === 0 || i === cols.length - 1;
289
+
290
+ // Check classes based on position
291
+ expect(containerDiv.classes().includes('th-shadow')).toBe(isFirstOrLast);
292
+ expect(containerDiv.classes().includes('px-4')).toBe(isFirstOrLast);
293
+ expect(containerDiv.classes().includes('px-2')).toBe(!isFirstOrLast);
286
294
  });
287
295
  });
288
296
 
@@ -399,9 +407,8 @@ describe('PTable.vue', () => {
399
407
  // Check subheader classes include th-shadow for fixed columns
400
408
  cols.forEach((col, i) => {
401
409
  const subheaderDiv = wrapper.find(`th[data-col-id="${col.id}"] > div:last-child`);
402
- if (i === 0 || i === cols.length - 1) {
403
- expect(subheaderDiv.classes()).toContain('th-shadow');
404
- }
410
+ const isFirstOrLast = i === 0 || i === cols.length - 1;
411
+ expect(subheaderDiv.classes().includes('th-shadow')).toBe(isFirstOrLast);
405
412
  });
406
413
  });
407
414
 
@@ -104,14 +104,16 @@ describe('PTabsPills.vue', () => {
104
104
 
105
105
  const buttons = await wrapper.findAll('button');
106
106
 
107
- buttons.forEach((button, i) => {
108
- if (i === 2) {
109
- expect(button.element.disabled).toBe(true);
110
- expect(button.classes()).toContain('text-p-gray-30');
111
- } else {
112
- expect(button.element.disabled).toBe(false);
113
- expect(button.classes()).not.toContain('text-p-gray-30');
114
- }
107
+ // Test the disabled button
108
+ const disabledButton = buttons[2];
109
+ expect(disabledButton.element.disabled).toBe(true);
110
+ expect(disabledButton.classes()).toContain('text-p-gray-30');
111
+
112
+ // Test the enabled buttons
113
+ const enabledButtons = buttons.filter((_, i) => i !== 2);
114
+ enabledButtons.forEach((button) => {
115
+ expect(button.element.disabled).toBe(false);
116
+ expect(button.classes()).not.toContain('text-p-gray-30');
115
117
  });
116
118
  });
117
119
  });
@@ -0,0 +1,47 @@
1
+ {
2
+ "squirrel": {
3
+ "close": "Schließen",
4
+ "action_bar_clear_all": "Alle löschen",
5
+ "select_list_items": "{count} Element | {count} Elemente",
6
+ "select_list_select_all": "Alle auswählen",
7
+ "select_list_select_all_filtered": "Alle gefilterten auswählen",
8
+ "select_list_clear_all": "Alle löschen",
9
+ "select_list_no_items_found": "Keine Elemente gefunden",
10
+ "dropdown_select_aria_label": "Dropdown-Auswahl",
11
+ "dropdown_select_remove_item": "Element entfernen",
12
+ "dropdown_select_clear_selection": "Auswahl löschen",
13
+ "dropdown_select_all_options_selected": "Alle Optionen ausgewählt",
14
+ "dropdown_select_options": "Option | Optionen",
15
+ "dropdown_select_selected": "ausgewählt",
16
+ "dropdown_select_items": "@:squirrel.select_list_items",
17
+ "dropdown_select_select_all": "@:squirrel.select_list_select_all",
18
+ "dropdown_select_select_all_filtered": "@:squirrel.select_list_select_all_filtered",
19
+ "dropdown_select_clear_all": "@:squirrel.select_list_clear_all",
20
+ "dropdown_select_add": "Hinzufügen",
21
+ "dropdown_select_no_items_found_type_to_add": "Keine Elemente gefunden. Tippen Sie zum Hinzufügen",
22
+ "dropdown_select_no_items_found": "@:squirrel.select_list_no_items_found",
23
+ "file_upload_dropzone": "Ablagebereich",
24
+ "file_upload_drag_or_select": "Ziehen oder {select}",
25
+ "file_upload_drop": "{fileWord} ablegen",
26
+ "file_upload_max": "Max. {count}",
27
+ "file_upload_one": "Eine",
28
+ "file_upload_files": "Datei | Dateien",
29
+ "file_upload_select": "{fileWord} auswählen",
30
+ "file_upload_with_size_less_than": "mit einer Größe unter {maxSize} | mit einer Größe unter {maxSize} jeweils",
31
+ "file_upload_max_files_exceeded": "Sie können maximal {count} {fileWord} hochladen.",
32
+ "file_upload_files_not_allowed": "{extension}-Dateien sind nicht erlaubt.",
33
+ "file_upload_file_size_exceeded": "Die Dateigröße von {fileName} überschreitet {maxSize}.",
34
+ "input_search_press_enter_to_search": "Drücken Sie die Eingabetaste zum Suchen",
35
+ "input_search_clear_search_input": "Sucheingabe löschen",
36
+ "pagination_go_to_previous_page": "zur vorherigen Seite gehen",
37
+ "pagination_go_to_page": "zu Seite {page} gehen",
38
+ "pagination_go_to_next_page": "zur nächsten Seite gehen",
39
+ "pagination_info_showing_results": "Zeige {from} bis {to} von {count} Ergebnissen",
40
+ "pagination_info_no_results_found": "Keine Ergebnisse gefunden",
41
+ "table_sort_sort": "SORTIEREN",
42
+ "table_sort_clear": "Löschen",
43
+ "table_sort_sort_ascending": "Aufsteigend sortieren",
44
+ "table_sort_sort_descending": "Absteigend sortieren",
45
+ "tabs_pills_aria_label": "Tab-Pillen"
46
+ }
47
+ }