Skip to content

Commit dd3bf63

Browse files
committed
fix: clean up whitespace in test files for consistency
1 parent 0cc84f7 commit dd3bf63

3 files changed

Lines changed: 38 additions & 26 deletions

File tree

test/components/VTour.spec.ts

Lines changed: 35 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,10 @@ describe('VTour Component - Comprehensive Test Suite', () => {
6767
</div>
6868
</div>
6969
`;
70-
70+
7171
// Remove any previous test structure
7272
document.querySelector('#app')?.remove();
73-
73+
7474
// Append new test structure
7575
document.body.insertAdjacentHTML('beforeend', testStructure);
7676

@@ -89,11 +89,11 @@ describe('VTour Component - Comprehensive Test Suite', () => {
8989
const mountPoint = document.createElement('div');
9090
mountPoint.id = 'vtour-mount';
9191
document.body.appendChild(mountPoint);
92-
92+
9393
wrapper = mount(VTour, {
9494
props: {
9595
steps: mockSteps,
96-
autoStart: false, // Start manually so we have control
96+
autoStart: false, // Start manually so we have control
9797
startDelay: 0,
9898
teleportDelay: 0,
9999
},
@@ -109,7 +109,7 @@ describe('VTour Component - Comprehensive Test Suite', () => {
109109

110110
// Manually start and wait for tour to be ready
111111
const tip = await startAndWaitReady(wrapper);
112-
112+
113113
// Verify tour is started by checking internal state AND DOM
114114
expect(wrapper.vm.tourVisible).toBe(true);
115115
expect(tip).toBeTruthy(); // startAndWaitReady returns the tooltip element
@@ -141,12 +141,12 @@ describe('VTour Component - Comprehensive Test Suite', () => {
141141
const mountPoint = document.createElement('div');
142142
mountPoint.id = 'vtour-mount';
143143
document.body.appendChild(mountPoint);
144-
144+
145145
wrapper = mount(VTour, {
146146
props: {
147147
steps: mockSteps,
148148
backdrop: true,
149-
autoStart: false, // Start manually
149+
autoStart: false, // Start manually
150150
startDelay: 0,
151151
teleportDelay: 0,
152152
},
@@ -163,7 +163,7 @@ describe('VTour Component - Comprehensive Test Suite', () => {
163163

164164
// Manually start and wait for tour to be ready
165165
await startAndWaitReady(wrapper);
166-
166+
167167
// Check backdrop visibility state
168168
expect(wrapper.vm.backdropVisible).toBe(true);
169169
});
@@ -519,18 +519,22 @@ describe('VTour Component - Comprehensive Test Suite', () => {
519519
const targetElement = document.querySelector('#step1');
520520

521521
// Initially, element should not be highlighted
522-
expect(targetElement?.classList.contains('vjt-highlight-tour')).toBe(false);
522+
expect(targetElement?.classList.contains('vjt-highlight-tour')).toBe(
523+
false
524+
);
523525

524526
// Start tour which will apply highlight
525527
await startAndWaitReady(wrapper);
526-
528+
527529
// Wait for highlight to be applied
528530
await nextTick();
529531
await flushVue();
530532

531533
// Now it should be highlighted (default name is 'tour', so class is 'vjt-highlight-tour')
532534
expect(wrapper.vm.tourVisible).toBe(true);
533-
expect(targetElement?.classList.contains('vjt-highlight-tour')).toBe(true);
535+
expect(targetElement?.classList.contains('vjt-highlight-tour')).toBe(
536+
true
537+
);
534538
});
535539

536540
it('should have CSS selector that matches highlight class without name', async () => {
@@ -545,14 +549,14 @@ describe('VTour Component - Comprehensive Test Suite', () => {
545549
});
546550

547551
const targetElement = document.querySelector('#step1') as HTMLElement;
548-
552+
549553
// Start tour to apply highlight
550554
await startAndWaitReady(wrapper);
551-
555+
552556
// Wait for highlight to be applied
553557
await nextTick();
554558
await flushVue();
555-
559+
556560
expect(wrapper.vm.tourVisible).toBe(true);
557561
// Empty name produces 'vjt-highlight' class (no hyphen suffix)
558562
expect(targetElement.classList.contains('vjt-highlight')).toBe(true);
@@ -562,10 +566,12 @@ describe('VTour Component - Comprehensive Test Suite', () => {
562566
const computedStyle = window.getComputedStyle(targetElement);
563567
expect(computedStyle.outline).toBeTruthy();
564568
expect(computedStyle.outline).not.toBe('none');
565-
569+
566570
// Verify actual CSS is loaded in document
567571
const styles = Array.from(document.querySelectorAll('style'));
568-
const hasHighlightCSS = styles.some(s => s.textContent?.includes('vjt-highlight'));
572+
const hasHighlightCSS = styles.some((s) =>
573+
s.textContent?.includes('vjt-highlight')
574+
);
569575
expect(hasHighlightCSS).toBe(true);
570576
});
571577

@@ -583,11 +589,15 @@ describe('VTour Component - Comprehensive Test Suite', () => {
583589
wrapper.vm.updateHighlight();
584590
await nextTick();
585591

586-
expect(targetElement.classList.contains('vjt-highlight-custom-tour')).toBe(true);
592+
expect(
593+
targetElement.classList.contains('vjt-highlight-custom-tour')
594+
).toBe(true);
587595

588596
// Verify CSS is loaded in document
589597
const styles = Array.from(document.querySelectorAll('style'));
590-
const hasHighlightCSS = styles.some(s => s.textContent?.includes('vjt-highlight'));
598+
const hasHighlightCSS = styles.some((s) =>
599+
s.textContent?.includes('vjt-highlight')
600+
);
591601
expect(hasHighlightCSS).toBe(true);
592602
});
593603

@@ -605,11 +615,11 @@ describe('VTour Component - Comprehensive Test Suite', () => {
605615

606616
// Start tour to apply highlight
607617
await startAndWaitReady(wrapper);
608-
618+
609619
// Wait for highlight to be applied
610620
await nextTick();
611621
await flushVue();
612-
622+
613623
// Verify the component added the highlight (default name 'tour' = 'vjt-highlight-tour')
614624
expect(wrapper.vm.tourVisible).toBe(true);
615625
expect(targetElement.classList.contains('vjt-highlight-tour')).toBe(true);
@@ -677,7 +687,7 @@ describe('VTour Component - Comprehensive Test Suite', () => {
677687
});
678688

679689
await startAndWaitReady(wrapper);
680-
690+
681691
// Backdrop should be visible
682692
expect(wrapper.vm.backdropVisible).toBe(true);
683693

@@ -1308,7 +1318,7 @@ describe('VTour Component - Comprehensive Test Suite', () => {
13081318
expect(wrapper.vm.backdropVisible).toBe(true);
13091319
// Note: Backdrop is teleported to body, so checking vm state is appropriate
13101320
// The actual rendering is tested by the component's template logic
1311-
1321+
13121322
document.body.removeChild(targetDiv);
13131323
});
13141324

@@ -1482,7 +1492,9 @@ describe('VTour Component - Comprehensive Test Suite', () => {
14821492
expect(wrapper.vm.currentPlacement).toBeDefined();
14831493
// Verify the component's positioning logic updated the placement
14841494
// This tests real behavior: component queries DOM, calls positioning, updates state
1485-
expect(['top', 'bottom', 'left', 'right']).toContain(wrapper.vm.currentPlacement);
1495+
expect(['top', 'bottom', 'left', 'right']).toContain(
1496+
wrapper.vm.currentPlacement
1497+
);
14861498

14871499
// Verify component is in correct state after positioning
14881500
expect(wrapper.vm.tourVisible).toBe(true);

test/helpers/mountVTour.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ export function mountVTour(overrides: any = {}) {
1414
// Disable scrolling in tests to avoid timing issues with jump.js
1515
noScroll: overrides.noScroll ?? true,
1616
};
17-
17+
1818
// Create a mount point that doesn't interfere with target elements
1919
const mountPoint = document.createElement('div');
2020
mountPoint.id = 'vtour-mount';
2121
document.body.appendChild(mountPoint);
22-
22+
2323
return mount(VTour, {
2424
props: { ...base, ...overrides },
2525
attachTo: mountPoint,

test/setup.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ beforeEach(() => {
5454
const head = document.createElement('head');
5555
document.documentElement.insertBefore(head, document.body);
5656
}
57-
57+
5858
// Re-inject compiled CSS for each test
5959
if (compiledCSS) {
6060
const style = document.createElement('style');

0 commit comments

Comments
 (0)