import { setupAndroidBackButton, setupNativeChrome } from './nativeChrome';

describe('nativeChrome', () => {
  const originalCapacitor = window.Capacitor;

  afterEach(() => {
    window.Capacitor = originalCapacitor;
    jest.resetModules();
    jest.clearAllMocks();
  });

  test('setupAndroidBackButton is no-op without Capacitor', async () => {
    delete window.Capacitor;
    const unsub = await setupAndroidBackButton();
    expect(unsub).toBeUndefined();
  });

  test('setupNativeChrome is no-op without Capacitor', async () => {
    delete window.Capacitor;
    await expect(setupNativeChrome()).resolves.toBeUndefined();
  });
});
