import assert from "node:assert/strict";
import test from "node:test";
import { Style } from "@capacitor/status-bar";
import { syncSystemBars } from "./system-bars.js";

test("uses readable Android status-bar text for each app theme", async () => {
  const calls = [];
  const statusBar = {
    setStyle: async (options) => calls.push(["style", options]),
    setBackgroundColor: async (options) => calls.push(["background", options])
  };

  await syncSystemBars("light", { isAndroid: true }, statusBar);
  assert.deepEqual(calls, [
    ["style", { style: Style.Light }],
    ["background", { color: "#f7f7f8" }]
  ]);

  calls.length = 0;
  await syncSystemBars("dark", { isAndroid: true }, statusBar);
  assert.deepEqual(calls, [
    ["style", { style: Style.Dark }],
    ["background", { color: "#15171b" }]
  ]);
});

