Skip to content

Commit 0cc84f7

Browse files
committed
fix: ensure empty name produces correct 'vjt-highlight' class without trailing hyphen
1 parent a1367fe commit 0cc84f7

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

test/components/VTour.spec.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -537,6 +537,7 @@ describe('VTour Component - Comprehensive Test Suite', () => {
537537
wrapper = mount(VTour, {
538538
props: {
539539
steps: mockSteps,
540+
name: '', // Empty name should produce 'vjt-highlight' class
540541
highlight: true,
541542
autoStart: false,
542543
},
@@ -553,10 +554,15 @@ describe('VTour Component - Comprehensive Test Suite', () => {
553554
await flushVue();
554555

555556
expect(wrapper.vm.tourVisible).toBe(true);
556-
// Default name is 'tour', so class is 'vjt-highlight-tour'
557-
// CSS selector [class*="vjt-highlight"] should match this
558-
expect(targetElement.classList.contains('vjt-highlight-tour')).toBe(true);
559-
557+
// Empty name produces 'vjt-highlight' class (no hyphen suffix)
558+
expect(targetElement.classList.contains('vjt-highlight')).toBe(true);
559+
560+
// CRITICAL: Verify CSS selector [class*="vjt-highlight"] matches 'vjt-highlight'
561+
// This will FAIL if selector is [class*="vjt-highlight-"] (with trailing dash)
562+
const computedStyle = window.getComputedStyle(targetElement);
563+
expect(computedStyle.outline).toBeTruthy();
564+
expect(computedStyle.outline).not.toBe('none');
565+
560566
// Verify actual CSS is loaded in document
561567
const styles = Array.from(document.querySelectorAll('style'));
562568
const hasHighlightCSS = styles.some(s => s.textContent?.includes('vjt-highlight'));

0 commit comments

Comments
 (0)