@@ -5,8 +5,6 @@ import { ACTIONS, LIFECYCLE, STATUS } from 'react-joyride'
55import { useTour } from './useTour'
66import { TOUR_STEPS } from '../components/Tour/tourSteps'
77
8- const STORAGE_KEY = 'pyrit-tour-completed'
9-
108// Minimal EventData shape — only fields our handler reads
119function makeEvent ( overrides : Record < string , unknown > = { } ) {
1210 return {
@@ -45,17 +43,6 @@ describe('useTour', () => {
4543 jest . restoreAllMocks ( )
4644 } )
4745
48- it ( 'returns hasCompletedTour=false when localStorage is empty' , ( ) => {
49- const { result } = renderHook ( ( ) => useTour ( onNavigate , true , 'home' ) )
50- expect ( result . current . hasCompletedTour ) . toBe ( false )
51- } )
52-
53- it ( 'returns hasCompletedTour=true when localStorage flag is set' , ( ) => {
54- localStorage . setItem ( STORAGE_KEY , 'true' )
55- const { result } = renderHook ( ( ) => useTour ( onNavigate , true , 'home' ) )
56- expect ( result . current . hasCompletedTour ) . toBe ( true )
57- } )
58-
5946 it ( 'startTour sets run=true immediately when already on home' , ( ) => {
6047 const { result } = renderHook ( ( ) => useTour ( onNavigate , true , 'home' ) )
6148
@@ -116,7 +103,7 @@ describe('useTour', () => {
116103 expect ( result . current . tourProps . stepIndex ) . toBe ( 0 )
117104 } )
118105
119- it ( 'stops tour on ACTIONS.CLOSE and persists to localStorage ' , ( ) => {
106+ it ( 'stops tour on ACTIONS.CLOSE' , ( ) => {
120107 const { result } = renderHook ( ( ) => useTour ( onNavigate , true , 'home' ) )
121108
122109 act ( ( ) => { result . current . startTour ( ) } )
@@ -125,9 +112,7 @@ describe('useTour', () => {
125112 act ( ( ) => {
126113 result . current . tourProps . onEvent ( makeEvent ( { action : ACTIONS . CLOSE } ) )
127114 } )
128-
129115 expect ( result . current . tourProps . run ) . toBe ( false )
130- expect ( localStorage . getItem ( STORAGE_KEY ) ) . toBe ( 'true' )
131116 } )
132117
133118 it ( 'stops tour on STATUS.SKIPPED' , ( ) => {
@@ -138,9 +123,7 @@ describe('useTour', () => {
138123 act ( ( ) => {
139124 result . current . tourProps . onEvent ( makeEvent ( { status : STATUS . SKIPPED } ) )
140125 } )
141-
142126 expect ( result . current . tourProps . run ) . toBe ( false )
143- expect ( localStorage . getItem ( STORAGE_KEY ) ) . toBe ( 'true' )
144127 } )
145128
146129 it ( 'stops tour on STATUS.FINISHED' , ( ) => {
@@ -257,9 +240,7 @@ describe('useTour', () => {
257240 index : lastIndex ,
258241 } ) )
259242 } )
260-
261243 expect ( result . current . tourProps . run ) . toBe ( false )
262- expect ( localStorage . getItem ( STORAGE_KEY ) ) . toBe ( 'true' )
263244 } )
264245
265246 it ( 'clears pending step when tour is cancelled during view switch' , ( ) => {
0 commit comments