Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions .github/workflows/feed-env-audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,18 @@ jobs:
bun-version: latest

- name: Install dependencies
# Match build-agent-image.yml: bun 1.3.14 has a frozen-lockfile
# bug with workspace optional peers (node-llama-cpp on
# plugin-local-inference) that reports drift even on a freshly
# generated lockfile. Use --no-frozen-lockfile so audit doesn't
# gate on this upstream issue.
run: bun install --no-frozen-lockfile
run: |
if bun install --frozen-lockfile; then
exit 0
fi

# Bun 1.3.14 can report frozen-lockfile drift with workspace optional
# peers even when a non-frozen install rewrites an identical bun.lock.
# Preserve the lockfile gate by allowing the install only when
# bun.lock is byte-for-byte unchanged.
bun install --no-frozen-lockfile
git diff --exit-code -- bun.lock

- name: Env audit check
run: bun run --cwd packages/feed env:audit:check
continue-on-error: true

14 changes: 11 additions & 3 deletions packages/agent/src/__tests__/game-tui-mounted-surfaces.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import { existsSync, readdirSync } from "node:fs";
import { createRequire } from "node:module";
import { dirname, join } from "node:path";
import { fireEvent, screen } from "@testing-library/dom";
import type ReactTypes from "react";
import { afterEach, describe, expect, it, vi } from "vitest";

Expand Down Expand Up @@ -163,6 +162,15 @@ function renderState(component: ReactTypes.ReactElement) {
return JSON.parse(element?.getAttribute("data-view-state") ?? "{}");
}

function getElementByText(container: HTMLElement, text: string) {
const elements = Array.from(container.querySelectorAll<HTMLElement>("*"));
const match = elements.find((element) => element.textContent?.trim() === text);
if (!match) {
throw new Error(`Unable to find element with text: ${text}`);
}
return match;
}

afterEach(() => {
cleanupSurfaces();
vi.clearAllMocks();
Expand Down Expand Up @@ -299,9 +307,9 @@ describe("game TUI mounted surfaces", () => {
},
];

renderSurface(React.createElement(ClawvilleTuiView));
const { container } = renderSurface(React.createElement(ClawvilleTuiView));
await act(async () => {
fireEvent.click(screen.getByText("Visit nearest"));
getElementByText(container, "Visit nearest").click();
});
await vi.waitFor(() =>
expect(sendAppRunMessage).toHaveBeenCalledWith("run-1", "Visit nearest"),
Expand Down
Loading