import {
  describe,
  expect,
  it
} from 'vitest';

import { resolveMobileSqliteDatabaseName } from './mobile-sqlite-database-name.rules';

describe('mobile-sqlite-database-name.rules', () => {
  it('scopes sqlite files per authenticated user', () => {
    expect(resolveMobileSqliteDatabaseName('user-123')).toBe('metoyou__user-123');
  });

  it('uses an anonymous scope before login', () => {
    expect(resolveMobileSqliteDatabaseName(null)).toBe('metoyou__anonymous');
  });
});
