@blotch/dolan 22.2.4 → 22.2.6
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/dist/commands/add.test.js +2 -0
- package/dist/commands/add.test.js.map +1 -1
- package/dist/commands/doctor.js +78 -21
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/doctor.test.js +167 -26
- package/dist/commands/doctor.test.js.map +1 -1
- package/dist/commands/init.test.js +4 -7
- package/dist/commands/init.test.js.map +1 -1
- package/dist/commands/update.d.ts +3 -1
- package/dist/commands/update.js +78 -15
- package/dist/commands/update.js.map +1 -1
- package/dist/commands/update.test.js +257 -2
- package/dist/commands/update.test.js.map +1 -1
- package/dist/lockfile.d.ts +10 -0
- package/dist/lockfile.js +20 -1
- package/dist/lockfile.js.map +1 -1
- package/dist/lockfile.test.js +43 -3
- package/dist/lockfile.test.js.map +1 -1
- package/dist/registry.js +73 -11
- package/dist/registry.js.map +1 -1
- package/dist/registry.test.js +16 -3
- package/dist/registry.test.js.map +1 -1
- package/dist/test-utils.d.ts +24 -2
- package/dist/test-utils.js +41 -2
- package/dist/test-utils.js.map +1 -1
- package/dist/ui/boolean-inputs.test.ts +76 -0
- package/dist/ui/components/action-sheet/action-sheet.test.ts +370 -1
- package/dist/ui/components/action-sheet/action-sheet.ts +306 -28
- package/dist/ui/components/action-sheet/index.ts +1 -0
- package/dist/ui/components/alert-dialog/alert-dialog.test.ts +552 -8
- package/dist/ui/components/alert-dialog/alert-dialog.ts +644 -36
- package/dist/ui/components/alert-dialog/index.ts +5 -0
- package/dist/ui/components/area-chart/area-chart.ts +3 -2
- package/dist/ui/components/badge/badge.ts +2 -1
- package/dist/ui/components/bottom-sheet/bottom-sheet.test.ts +968 -3
- package/dist/ui/components/bottom-sheet/bottom-sheet.ts +1021 -95
- package/dist/ui/components/bottom-sheet/index.ts +7 -1
- package/dist/ui/components/button/button.test.ts +36 -1
- package/dist/ui/components/button/button.ts +17 -7
- package/dist/ui/components/button-group/button-group.test.ts +53 -9
- package/dist/ui/components/button-group/button-group.ts +67 -21
- package/dist/ui/components/card/card.test.ts +16 -0
- package/dist/ui/components/card/card.ts +2 -1
- package/dist/ui/components/chart/chart-presets.ts +6 -6
- package/dist/ui/components/chart/chart.test.ts +14 -0
- package/dist/ui/components/chart/chart.ts +10 -3
- package/dist/ui/components/checkbox/checkbox.ts +2 -1
- package/dist/ui/components/collapsible/collapsible.ts +2 -1
- package/dist/ui/components/dialog/dialog.ts +6 -6
- package/dist/ui/components/dock/dock-scroll.ts +9 -0
- package/dist/ui/components/dock/dock-search.test.ts +594 -0
- package/dist/ui/components/dock/dock.test.ts +4 -1
- package/dist/ui/components/dock/dock.ts +529 -51
- package/dist/ui/components/dynamic-color/dynamic-color.test.ts +144 -0
- package/dist/ui/components/dynamic-color/dynamic-color.ts +146 -0
- package/dist/ui/components/dynamic-color/index.ts +5 -0
- package/dist/ui/components/glass/glass.test.ts +39 -1
- package/dist/ui/components/glass/glass.ts +87 -17
- package/dist/ui/components/glass/index.ts +1 -0
- package/dist/ui/components/icon/icon-theme.test.ts +28 -0
- package/dist/ui/components/icon/icon-theme.ts +38 -7
- package/dist/ui/components/input/input.ts +2 -1
- package/dist/ui/components/label/label.ts +8 -2
- package/dist/ui/components/line-chart/line-chart.ts +3 -2
- package/dist/ui/components/list/list.ts +5 -4
- package/dist/ui/components/menu/menu-popup.test.ts +18 -14
- package/dist/ui/components/menu/menu-popup.ts +24 -3
- package/dist/ui/components/menu/menu.test.ts +99 -5
- package/dist/ui/components/menu/menu.ts +74 -34
- package/dist/ui/components/nav-drawer/nav-drawer.ts +3 -2
- package/dist/ui/components/navigation-bar/index.ts +1 -0
- package/dist/ui/components/navigation-bar/navigation-bar.test.ts +425 -0
- package/dist/ui/components/navigation-bar/navigation-bar.ts +411 -0
- package/dist/ui/components/popover/index.ts +9 -0
- package/dist/ui/components/popover/popover-panel.test.ts +735 -0
- package/dist/ui/components/popover/popover-panel.ts +603 -0
- package/dist/ui/components/popover/popover.test.ts +286 -0
- package/dist/ui/components/popover/popover.ts +207 -0
- package/dist/ui/components/progress/progress.ts +2 -1
- package/dist/ui/components/radio-group/radio-group.ts +2 -1
- package/dist/ui/components/scroll-area/scroll-area.ts +4 -3
- package/dist/ui/components/search-field/index.ts +15 -0
- package/dist/ui/components/search-field/keyboard.test.ts +147 -0
- package/dist/ui/components/search-field/keyboard.ts +123 -0
- package/dist/ui/components/search-field/search-field.test.ts +549 -0
- package/dist/ui/components/search-field/search-field.ts +628 -0
- package/dist/ui/components/segmented-control/index.ts +8 -0
- package/dist/ui/components/segmented-control/segmented-control.test.ts +861 -0
- package/dist/ui/components/segmented-control/segmented-control.ts +884 -0
- package/dist/ui/components/select/select.ts +2 -1
- package/dist/ui/components/sheet/sheet.test.ts +90 -3
- package/dist/ui/components/sheet/sheet.ts +59 -4
- package/dist/ui/components/slider/index.ts +1 -0
- package/dist/ui/components/slider/slider.test.ts +695 -0
- package/dist/ui/components/slider/slider.ts +901 -0
- package/dist/ui/components/switch/index.ts +1 -1
- package/dist/ui/components/switch/switch.test.ts +464 -48
- package/dist/ui/components/switch/switch.ts +613 -43
- package/dist/ui/components/tabs/index.ts +7 -1
- package/dist/ui/components/tabs/tabs.test.ts +278 -2
- package/dist/ui/components/tabs/tabs.ts +233 -30
- package/dist/ui/components/textarea/textarea.ts +2 -1
- package/dist/ui/components/toggle/index.ts +1 -0
- package/dist/ui/components/toggle/toggle.test.ts +310 -4
- package/dist/ui/components/toggle/toggle.ts +241 -26
- package/dist/ui/components/toolbar/bar-scroll.test.ts +310 -0
- package/dist/ui/components/toolbar/bar-scroll.ts +372 -0
- package/dist/ui/components/toolbar/index.ts +12 -0
- package/dist/ui/components/toolbar/toolbar.test.ts +438 -0
- package/dist/ui/components/toolbar/toolbar.ts +535 -0
- package/dist/utils/analyze.d.ts +10 -5
- package/dist/utils/analyze.js +3 -2
- package/dist/utils/analyze.js.map +1 -1
- package/dist/utils/installed.d.ts +13 -1
- package/dist/utils/installed.js +17 -0
- package/dist/utils/installed.js.map +1 -1
- package/dist/utils/installed.test.js +39 -1
- package/dist/utils/installed.test.js.map +1 -1
- package/dist/utils/tailwind.d.ts +25 -5
- package/dist/utils/tailwind.js +53 -14
- package/dist/utils/tailwind.js.map +1 -1
- package/dist/utils/tailwind.test.js +85 -22
- package/dist/utils/tailwind.test.js.map +1 -1
- package/package.json +1 -1
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
render,
|
|
5
5
|
waitForUpdate,
|
|
6
6
|
} from '@blotch/angular-lynx-testing-library';
|
|
7
|
-
import { LYNX_ELEMENTS } from '@blotch/angular-lynx';
|
|
7
|
+
import { LYNX_ELEMENTS, LynxAccessibilitySettings } from '@blotch/angular-lynx';
|
|
8
8
|
import {
|
|
9
9
|
type MockInstance,
|
|
10
10
|
afterEach,
|
|
@@ -18,7 +18,14 @@ import {
|
|
|
18
18
|
type LynxMainThread,
|
|
19
19
|
lynxMainThread,
|
|
20
20
|
} from '../../../test-utils/lynx-main-thread';
|
|
21
|
-
import {
|
|
21
|
+
import { fireLynxEvent } from '../../../test-utils/fire-lynx-event';
|
|
22
|
+
import {
|
|
23
|
+
type TabsListVariant,
|
|
24
|
+
UiTabs,
|
|
25
|
+
UiTabsContent,
|
|
26
|
+
UiTabsList,
|
|
27
|
+
UiTabsTrigger,
|
|
28
|
+
} from './tabs';
|
|
22
29
|
|
|
23
30
|
@Component({
|
|
24
31
|
imports: [UiTabs, UiTabsList, UiTabsTrigger, UiTabsContent, LYNX_ELEMENTS],
|
|
@@ -84,6 +91,9 @@ describe('UiTabs', () => {
|
|
|
84
91
|
// that has both its own and the given class.
|
|
85
92
|
expect(container.querySelector('.flex-col.w-80')).not.toBeNull();
|
|
86
93
|
expect(container.querySelector('.rounded-lg.mb-2')).not.toBeNull();
|
|
94
|
+
expect(
|
|
95
|
+
container.querySelector('[accessibility-traits="tabbar"]'),
|
|
96
|
+
).not.toBeNull();
|
|
87
97
|
expect(trigger('Account').classList).toContain('rounded-sm');
|
|
88
98
|
expect(trigger('Account').classList).toContain('px-4');
|
|
89
99
|
expect(panel('Account panel').classList).toContain('mt-2');
|
|
@@ -113,6 +123,28 @@ describe('UiTabs', () => {
|
|
|
113
123
|
expect(trigger('Account').classList).toContain('bg-transparent');
|
|
114
124
|
});
|
|
115
125
|
|
|
126
|
+
it('reads to a screen reader as a tab bar, with the selected tab selected', async () => {
|
|
127
|
+
const { getByRole, tap } = await renderTabs();
|
|
128
|
+
expect(getByRole('tablist')).toBeTruthy();
|
|
129
|
+
expect(
|
|
130
|
+
getByRole('button', { name: 'Account', selected: true }),
|
|
131
|
+
).toBeTruthy();
|
|
132
|
+
expect(
|
|
133
|
+
getByRole('button', { name: 'Billing', selected: false }),
|
|
134
|
+
).toBeTruthy();
|
|
135
|
+
await tap('Billing');
|
|
136
|
+
expect(
|
|
137
|
+
getByRole('button', { name: 'Billing', selected: true }),
|
|
138
|
+
).toBeTruthy();
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
it('clips a hidden panel, whose text iOS would draw from its corner', async () => {
|
|
142
|
+
const { panel } = await renderTabs();
|
|
143
|
+
const hostOf = (text: string) => panel(text).parentElement as HTMLElement;
|
|
144
|
+
expect(hostOf('Billing panel').style.overflow).toBe('hidden');
|
|
145
|
+
expect(hostOf('Account panel').style.overflow).toBe('');
|
|
146
|
+
});
|
|
147
|
+
|
|
116
148
|
it('shows the tab its value is set to, without reporting a change', async () => {
|
|
117
149
|
const { host, displayOf } = await renderTabs();
|
|
118
150
|
host.value.set('contact');
|
|
@@ -237,6 +269,31 @@ describe('UiTabs', () => {
|
|
|
237
269
|
]);
|
|
238
270
|
});
|
|
239
271
|
|
|
272
|
+
it('changes at once under Reduce Motion', async () => {
|
|
273
|
+
const reduced = {
|
|
274
|
+
reduceMotion: signal(true),
|
|
275
|
+
reduceTransparency: signal(false),
|
|
276
|
+
increaseContrast: signal(false),
|
|
277
|
+
};
|
|
278
|
+
const result = await render(TabsHost, {
|
|
279
|
+
providers: [{ provide: LynxAccessibilitySettings, useValue: reduced }],
|
|
280
|
+
});
|
|
281
|
+
await waitForUpdate();
|
|
282
|
+
// Only this test's animations: the last test's panels may still have
|
|
283
|
+
// had a reveal waiting for its tick.
|
|
284
|
+
animate.mockClear();
|
|
285
|
+
fireEvent.tap(result.getByText('Billing').parentElement!);
|
|
286
|
+
await waitForUpdate();
|
|
287
|
+
await waitForUpdate();
|
|
288
|
+
expect(animate).not.toHaveBeenCalled();
|
|
289
|
+
expect(
|
|
290
|
+
(
|
|
291
|
+
result.getByText('Billing panel').parentElement!
|
|
292
|
+
.parentElement as HTMLElement
|
|
293
|
+
).style.display,
|
|
294
|
+
).toBe('flex');
|
|
295
|
+
});
|
|
296
|
+
|
|
240
297
|
it("doesn't animate a selection that changed back within one frame", async () => {
|
|
241
298
|
const { host, trigger, tap } = await renderTabs();
|
|
242
299
|
await tap('Billing');
|
|
@@ -255,3 +312,222 @@ describe('UiTabs', () => {
|
|
|
255
312
|
});
|
|
256
313
|
});
|
|
257
314
|
});
|
|
315
|
+
|
|
316
|
+
@Component({
|
|
317
|
+
imports: [UiTabs, UiTabsList, UiTabsTrigger, UiTabsContent, LYNX_ELEMENTS],
|
|
318
|
+
template: `
|
|
319
|
+
<ui-tabs
|
|
320
|
+
[value]="value()"
|
|
321
|
+
(valueChange)="value.set($event)"
|
|
322
|
+
(changed)="changes.push($event)"
|
|
323
|
+
>
|
|
324
|
+
<ui-tabs-list [variant]="variant()">
|
|
325
|
+
@for (tab of tabs; track tab) {
|
|
326
|
+
<ui-tabs-trigger
|
|
327
|
+
[value]="tab"
|
|
328
|
+
[class]="tab === 'People' ? 'flex-[2]' : ''"
|
|
329
|
+
>{{ tab }}</ui-tabs-trigger
|
|
330
|
+
>
|
|
331
|
+
}
|
|
332
|
+
</ui-tabs-list>
|
|
333
|
+
@for (tab of tabs; track tab) {
|
|
334
|
+
<ui-tabs-content [value]="tab"
|
|
335
|
+
><text>{{ tab }} panel</text></ui-tabs-content
|
|
336
|
+
>
|
|
337
|
+
}
|
|
338
|
+
</ui-tabs>
|
|
339
|
+
`,
|
|
340
|
+
})
|
|
341
|
+
class SegmentedTabsHost {
|
|
342
|
+
readonly tabs = ['Photos', 'Albums', 'People'];
|
|
343
|
+
readonly value = signal('Photos');
|
|
344
|
+
readonly variant = signal<TabsListVariant>('segmented');
|
|
345
|
+
readonly changes: string[] = [];
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
/**
|
|
349
|
+
* A trigger outside a list, which has no segmented control to report to.
|
|
350
|
+
*/
|
|
351
|
+
@Component({
|
|
352
|
+
imports: [UiTabs, UiTabsTrigger, LYNX_ELEMENTS],
|
|
353
|
+
template: `
|
|
354
|
+
<ui-tabs value="a">
|
|
355
|
+
<ui-tabs-trigger value="a">Alone</ui-tabs-trigger>
|
|
356
|
+
</ui-tabs>
|
|
357
|
+
`,
|
|
358
|
+
})
|
|
359
|
+
class LoneTriggerHost {}
|
|
360
|
+
|
|
361
|
+
/** Accessibility settings, as the host app would report them. */
|
|
362
|
+
const settings = {
|
|
363
|
+
reduceMotion: signal(false),
|
|
364
|
+
reduceTransparency: signal(false),
|
|
365
|
+
increaseContrast: signal(false),
|
|
366
|
+
};
|
|
367
|
+
|
|
368
|
+
describe('UiTabsList, segmented', () => {
|
|
369
|
+
// The indicator's selector isn't a Lynx element, so the renderer falls
|
|
370
|
+
// back to a <view> for it and warns.
|
|
371
|
+
beforeEach(() => {
|
|
372
|
+
vi.spyOn(console, 'warn').mockImplementation(() => {});
|
|
373
|
+
});
|
|
374
|
+
|
|
375
|
+
afterEach(() => {
|
|
376
|
+
vi.restoreAllMocks();
|
|
377
|
+
vi.unstubAllGlobals();
|
|
378
|
+
});
|
|
379
|
+
|
|
380
|
+
const renderSegmented = async (
|
|
381
|
+
platform = { platform: 'iOS', osVersion: '26.0' },
|
|
382
|
+
) => {
|
|
383
|
+
vi.stubGlobal('SystemInfo', platform);
|
|
384
|
+
const result = await render(SegmentedTabsHost, {
|
|
385
|
+
providers: [{ provide: LynxAccessibilitySettings, useValue: settings }],
|
|
386
|
+
});
|
|
387
|
+
/**
|
|
388
|
+
* A trigger's own view, around its label.
|
|
389
|
+
*/
|
|
390
|
+
const trigger = (label: string) => result.getByText(label).parentElement!;
|
|
391
|
+
/**
|
|
392
|
+
* A trigger's host, the track's flex item.
|
|
393
|
+
*/
|
|
394
|
+
const slot = (label: string) => trigger(label).parentElement!;
|
|
395
|
+
const track = () => slot('Photos').parentElement!;
|
|
396
|
+
/**
|
|
397
|
+
* The indicator's frame, which moves between the tabs.
|
|
398
|
+
*/
|
|
399
|
+
const frame = () =>
|
|
400
|
+
track().querySelector<HTMLElement>('.h-full .bottom-0.top-0');
|
|
401
|
+
return {
|
|
402
|
+
...result,
|
|
403
|
+
host: result.componentRef.instance as SegmentedTabsHost,
|
|
404
|
+
trigger,
|
|
405
|
+
slot,
|
|
406
|
+
track,
|
|
407
|
+
frame,
|
|
408
|
+
measure: async () => {
|
|
409
|
+
for (const [label, width] of [
|
|
410
|
+
['Photos', 90],
|
|
411
|
+
['Albums', 90],
|
|
412
|
+
['People', 180],
|
|
413
|
+
] as const) {
|
|
414
|
+
fireEvent.layoutchange(slot(label), { detail: { width } });
|
|
415
|
+
}
|
|
416
|
+
await waitForUpdate();
|
|
417
|
+
},
|
|
418
|
+
/** The display of a panel's host element, which shows or hides it. */
|
|
419
|
+
displayOf: (text: string) =>
|
|
420
|
+
(result.getByText(text).parentElement!.parentElement as HTMLElement)
|
|
421
|
+
.style.display,
|
|
422
|
+
};
|
|
423
|
+
};
|
|
424
|
+
|
|
425
|
+
it("draws the platform's segmented control, filling its width, its tabs sharing it", async () => {
|
|
426
|
+
const { track, slot, trigger, frame, getByText } = await renderSegmented();
|
|
427
|
+
expect(track().classList).toContain('rounded-full');
|
|
428
|
+
expect(track().classList).not.toContain('self-start');
|
|
429
|
+
expect(slot('Albums').classList).toContain('flex-1');
|
|
430
|
+
expect(slot('People').classList).toContain('flex-[2]');
|
|
431
|
+
expect(trigger('Photos').classList).toContain('justify-center');
|
|
432
|
+
expect(getByText('Photos').classList).toContain('font-medium');
|
|
433
|
+
expect(getByText('Albums').classList).not.toContain('font-medium');
|
|
434
|
+
expect(frame()).not.toBeNull();
|
|
435
|
+
});
|
|
436
|
+
|
|
437
|
+
it("switches panels on a tap, without the default tabs' scale animation", async () => {
|
|
438
|
+
const animate = vi.spyOn(lynxMainThread(), '__ElementAnimate');
|
|
439
|
+
const { host, trigger, displayOf, getByRole } = await renderSegmented();
|
|
440
|
+
fireEvent.tap(trigger('Albums'));
|
|
441
|
+
await waitForUpdate();
|
|
442
|
+
expect(host.value()).toBe('Albums');
|
|
443
|
+
expect(host.changes).toEqual(['Albums']);
|
|
444
|
+
expect(displayOf('Albums panel')).toBe('flex');
|
|
445
|
+
expect(
|
|
446
|
+
getByRole('button', { name: 'Albums', selected: true }),
|
|
447
|
+
).toBeTruthy();
|
|
448
|
+
expect(
|
|
449
|
+
animate.mock.calls.filter(([target]) => target === trigger('Albums')),
|
|
450
|
+
).toEqual([]);
|
|
451
|
+
});
|
|
452
|
+
|
|
453
|
+
it('switches to the tab the indicator is dragged to', async () => {
|
|
454
|
+
const { host, trigger, track, frame, measure } = await renderSegmented();
|
|
455
|
+
await measure();
|
|
456
|
+
expect(frame()!.style.left).toBe('0px');
|
|
457
|
+
|
|
458
|
+
fireEvent.touchstart(trigger('Photos'), { touches: [{ pageX: 45 }] });
|
|
459
|
+
fireEvent.touchmove(trigger('Photos'), { touches: [{ pageX: 300 }] });
|
|
460
|
+
fireEvent.touchend(trigger('Photos'));
|
|
461
|
+
// The tap Lynx may send as the finger lifts doesn't pick Photos again.
|
|
462
|
+
fireEvent.tap(trigger('Photos'));
|
|
463
|
+
await waitForUpdate();
|
|
464
|
+
expect(host.value()).toBe('People');
|
|
465
|
+
expect(host.changes).toEqual(['People']);
|
|
466
|
+
expect(frame()!.style.left).toBe('180px');
|
|
467
|
+
|
|
468
|
+
// Taken away, a drag goes back.
|
|
469
|
+
fireEvent.touchstart(trigger('People'), { touches: [{ pageX: 270 }] });
|
|
470
|
+
fireEvent.touchmove(trigger('People'), { touches: [{ pageX: 20 }] });
|
|
471
|
+
fireEvent.touchcancel(trigger('People'));
|
|
472
|
+
await waitForUpdate();
|
|
473
|
+
expect(frame()!.style.left).toBe('180px');
|
|
474
|
+
|
|
475
|
+
// In the web preview, with the mouse, until it leaves the row.
|
|
476
|
+
fireEvent.mousedown(trigger('People'), { pageX: 270 });
|
|
477
|
+
fireEvent.mousemove(trigger('Albums'), { pageX: 150 });
|
|
478
|
+
fireLynxEvent(trigger('People'), 'mouseleave');
|
|
479
|
+
await waitForUpdate();
|
|
480
|
+
expect(frame()!.style.left).toBe('60px');
|
|
481
|
+
fireLynxEvent(track(), 'mouseleave');
|
|
482
|
+
await waitForUpdate();
|
|
483
|
+
expect(frame()!.style.left).toBe('180px');
|
|
484
|
+
|
|
485
|
+
fireEvent.mousedown(trigger('People'), { pageX: 270 });
|
|
486
|
+
fireEvent.mousemove(trigger('Albums'), { pageX: 150 });
|
|
487
|
+
fireEvent.mouseup(trigger('Albums'));
|
|
488
|
+
await waitForUpdate();
|
|
489
|
+
expect(host.value()).toBe('Albums');
|
|
490
|
+
});
|
|
491
|
+
|
|
492
|
+
it("is Material's connected button group on Android", async () => {
|
|
493
|
+
const { trigger, getByText } = await renderSegmented({
|
|
494
|
+
platform: 'Android',
|
|
495
|
+
osVersion: '15',
|
|
496
|
+
});
|
|
497
|
+
expect(trigger('Photos').classList).toContain('bg-primary');
|
|
498
|
+
expect(trigger('Photos').style.transition).toContain('background-color');
|
|
499
|
+
expect(getByText('Photos').classList).toContain('text-primary-foreground');
|
|
500
|
+
// The last tab rounds the group's end, and the one between has small
|
|
501
|
+
// corners.
|
|
502
|
+
expect(trigger('Albums').classList).toContain('rounded-[8px]');
|
|
503
|
+
expect(trigger('People').classList).toContain('rounded-r-[20px]');
|
|
504
|
+
// A press shows Material's state layer.
|
|
505
|
+
fireEvent.touchstart(trigger('Albums'), { touches: [{ pageX: 150 }] });
|
|
506
|
+
await waitForUpdate();
|
|
507
|
+
expect(trigger('Albums').querySelector('.opacity-10')).not.toBeNull();
|
|
508
|
+
});
|
|
509
|
+
|
|
510
|
+
it('goes back to the default tabs when the variant changes', async () => {
|
|
511
|
+
const { host, track, slot, frame } = await renderSegmented();
|
|
512
|
+
host.variant.set('default');
|
|
513
|
+
await waitForUpdate();
|
|
514
|
+
expect(track().classList).toContain('self-start');
|
|
515
|
+
expect(slot('Photos').classList).not.toContain('flex-1');
|
|
516
|
+
expect(frame()).toBeNull();
|
|
517
|
+
});
|
|
518
|
+
|
|
519
|
+
it('lets a trigger outside a list take touches as the default tabs do', async () => {
|
|
520
|
+
const result = await render(LoneTriggerHost);
|
|
521
|
+
const trigger = result.getByText('Alone').parentElement!;
|
|
522
|
+
fireEvent.layoutchange(trigger.parentElement!, { detail: { width: 80 } });
|
|
523
|
+
fireEvent.touchstart(trigger, { touches: [{ pageX: 10 }] });
|
|
524
|
+
fireEvent.touchmove(trigger, { touches: [{ pageX: 60 }] });
|
|
525
|
+
fireEvent.touchend(trigger);
|
|
526
|
+
fireEvent.touchcancel(trigger);
|
|
527
|
+
fireLynxEvent(trigger, 'mouseleave');
|
|
528
|
+
fireEvent.tap(trigger);
|
|
529
|
+
await waitForUpdate();
|
|
530
|
+
expect(trigger.classList).toContain('bg-background');
|
|
531
|
+
expect(trigger.parentElement!.classList).not.toContain('flex-1');
|
|
532
|
+
});
|
|
533
|
+
});
|