LibreChat/e2e/mcp-apps/workflow.test.mjs
lia-by-librechat[bot] e396ea9c7b 🫸 fix: Gate MCP App Views and Actions on User Intent (#16297)
* 🫸 fix: Gate MCP App Views and Actions on User Intent

* 🧪 ci: Run MCP Apps Browser Checks on Repository Bot PRs

* 🧲 test: Open App Before Checking Tool-Call Frames

* 🔎 fix: Wait for Stable App Views in Restored Browser Tests

* 🧪 test: Trace Grouped App View Activation in Browser CI

* 🧪 test: Diagnose Grouped App Click Propagation

* 🧪 test: Distinguish Native and React App Click Delivery

* 🧪 test: Inspect Grouped App Button Hit Target

* 🎟️ test: Open Grouped App Views After Scrolling Into Place

* 🧯 fix: Revoke App Approval Before Teardown Handshake

* 🫸 fix: Configure App Limits and Suspend Denied Actions

* 🧾 test: Expect Configured MCP App Limits in API Suites

* 🧱 fix: Isolate Approved App Messages From Composer Drafts

* 🛟 fix: Suspend Aborted App Actions and Restore View Focus

* 🦮 fix: Preserve Focus on App-Initiated Teardown

* 🧳 fix: Exclude Draft Agent State From App Messages

* 🧭 test: Preserve Legacy Null File Overrides

* 🧰 fix: Retain Selected MCP Tools Across App Messages

* 🧾 fix: Acknowledge Accepted App Turns and Disclose Selected Tools

---------

Co-authored-by: Lia <lia@librechat.ai>
(cherry picked from commit 6866732a88)

Original-PR: https://github.com/LibreChat-AI/LibreChat/pull/16297
2026-10-01 03:46:17 +00:00

30 lines
1.4 KiB
JavaScript

import assert from 'node:assert/strict';
import { readFileSync } from 'node:fs';
import { createRequire } from 'node:module';
import { test } from 'node:test';
const require = createRequire(import.meta.url);
const yaml = require('js-yaml');
const workflow = yaml.load(
readFileSync(new URL('../../.github/workflows/playwright-mock.yml', import.meta.url), 'utf8'),
);
// Check the shared eligibility predicate on both the fixture and the required E2E gate.
// Otherwise a bot-authored PR silently reports the browser lane as skipped.
test('canary bot branches can run the required Apps fixture without admitting external forks', () => {
for (const job of ['e2e_shards', 'mcp_tool_list_changed', 'mcp_apps', 'e2e']) {
const expression = workflow.jobs[job].if;
assert.match(expression, /github\.event_name == 'pull_request'/);
assert.match(expression, /github\.event\.pull_request != null/);
assert.match(
expression,
/\(contains\(fromJSON\('\["OWNER", "MEMBER", "COLLABORATOR"\]'\), github\.event\.pull_request\.author_association\) \|\|\s*github\.event\.pull_request\.head\.repo\.full_name == github\.repository\)/,
`${job} must require either a trusted association or a same-repository head`,
);
}
assert.ok(workflow.jobs.e2e.needs.includes('mcp_apps'));
assert.match(
workflow.jobs.e2e.steps.find((step) => step.name === 'Verify every Playwright job passed').if,
/needs\.mcp_apps\.result != 'success'/,
);
});