import { describe, expect, it } from 'vitest';
import { getTourSeen, resolveTourStepKeys, setTourSeen, TOUR_STORAGE_KEY } from './mobileTour';

describe('resolveTourStepKeys', () => {
  it('includes the event step when there are no events', () => {
    expect(resolveTourStepKeys(false)).toEqual(['event', 'qr', 'photos', 'push']);
  });

  it('omits the event step when events exist', () => {
    expect(resolveTourStepKeys(true)).toEqual(['qr', 'photos', 'push']);
  });
});

describe('tour storage helpers', () => {
  it('stores and reads the seen flag', () => {
    setTourSeen(false);
    expect(getTourSeen()).toBe(false);

    setTourSeen(true);
    expect(getTourSeen()).toBe(true);

    window.localStorage.removeItem(TOUR_STORAGE_KEY);
  });
});
