mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-10-21 01:22:54 +00:00
test(e2e): align assertions with action groups
This commit is contained in:
parent
be5b5ca92a
commit
6c904ba815
3 changed files with 13 additions and 15 deletions
|
|
@ -82,7 +82,7 @@ test.describe('activity labels', () => {
|
|||
|
||||
/**
|
||||
* The header is the feature: once a label lands it REPLACES the generic
|
||||
* "Used N tools" verb above the same tool cards.
|
||||
* "Ran N actions" verb above the same tool cards.
|
||||
*/
|
||||
test('renders the generated label as the tool-group header', async ({ page, request }) => {
|
||||
test.setTimeout(120000);
|
||||
|
|
@ -94,7 +94,7 @@ test.describe('activity labels', () => {
|
|||
await expect(
|
||||
messagesView(page).getByRole('button', { name: 'Stored two facts in memory' }),
|
||||
).toBeVisible({ timeout: 30000 });
|
||||
await expect(messagesView(page).getByRole('button', { name: 'Used 2 tools' })).toHaveCount(0);
|
||||
await expect(messagesView(page).getByRole('button', { name: /^Ran 2 actions/ })).toHaveCount(0);
|
||||
});
|
||||
|
||||
/**
|
||||
|
|
@ -141,7 +141,7 @@ test.describe('activity labels', () => {
|
|||
|
||||
/**
|
||||
* A whitespace-only label must fill null. There is deliberately no templated
|
||||
* stand-in ("ran 2 tools" only restates the cards), so the block renders
|
||||
* stand-in ("Ran 2 actions" only restates the cards), so the block renders
|
||||
* exactly as it would without the feature.
|
||||
*/
|
||||
test('leaves the generic header when the model returns a blank label', async ({
|
||||
|
|
@ -154,7 +154,7 @@ test.describe('activity labels', () => {
|
|||
|
||||
await runLabeledTurn(page, label);
|
||||
|
||||
await expect(messagesView(page).getByRole('button', { name: 'Used 2 tools' })).toBeVisible({
|
||||
await expect(messagesView(page).getByRole('button', { name: /^Ran 2 actions/ })).toBeVisible({
|
||||
timeout: 30000,
|
||||
});
|
||||
});
|
||||
|
|
@ -169,7 +169,7 @@ test.describe('activity labels', () => {
|
|||
|
||||
/** The turn still finished (asserted in runLabeledTurn) and the block kept
|
||||
* its generic header rather than rendering an empty row. */
|
||||
await expect(messagesView(page).getByRole('button', { name: 'Used 2 tools' })).toBeVisible({
|
||||
await expect(messagesView(page).getByRole('button', { name: /^Ran 2 actions/ })).toBeVisible({
|
||||
timeout: 30000,
|
||||
});
|
||||
/** At least one attempt was made and failed; the client may retry a 5xx,
|
||||
|
|
@ -191,7 +191,7 @@ test.describe('activity labels', () => {
|
|||
timeout: 60000,
|
||||
});
|
||||
|
||||
await expect(messagesView(page).getByRole('button', { name: 'Used 2 tools' })).toBeVisible();
|
||||
await expect(messagesView(page).getByRole('button', { name: /^Ran 2 actions/ })).toBeVisible();
|
||||
expect(await getLabelRequestsFor(request, label)).toHaveLength(0);
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -757,12 +757,11 @@ test.describe('agent handoffs', () => {
|
|||
});
|
||||
await expect(transferCard).toBeEnabled();
|
||||
await transferCard.click();
|
||||
await expect(
|
||||
messagesView(page).getByText('Handoff instructions:', { exact: true }),
|
||||
).toBeVisible();
|
||||
await expect(
|
||||
messagesView(page).getByText(JSON.stringify({ brief: payload }), { exact: true }),
|
||||
).toBeVisible();
|
||||
const handoffDetails = messagesView(page).getByRole('region', {
|
||||
name: 'Handoff instructions',
|
||||
});
|
||||
await expect(handoffDetails).toBeVisible();
|
||||
await expect(handoffDetails.getByText(payload, { exact: true })).toBeVisible();
|
||||
|
||||
await expect(page).toHaveURL(/\/c\/(?!new)/, { timeout: 15000 });
|
||||
const conversationUrl = page.url();
|
||||
|
|
|
|||
|
|
@ -162,7 +162,7 @@ async function submitAndCapture(page: Page, submit: Locator) {
|
|||
|
||||
async function expectCompletedApprovalToolOutput(page: Page, toolCallId: string, output: string) {
|
||||
const view = messagesView(page);
|
||||
const groupToggle = view.getByRole('button', { name: /^Used \d+ tools$/ }).last();
|
||||
const groupToggle = view.getByRole('button', { name: /^Ran \d+ actions/ }).last();
|
||||
const toolCall = view.locator(`[data-testid="tool-call"][data-tool-call-id="${toolCallId}"]`);
|
||||
|
||||
// On reload, the conversation arrives asynchronously and multi-tool groups
|
||||
|
|
@ -511,8 +511,7 @@ test.describe('tool approvals', () => {
|
|||
await expect(submit).toBeEnabled();
|
||||
|
||||
const groupToggle = messagesView(page).getByRole('button', {
|
||||
name: 'Used 2 tools',
|
||||
exact: true,
|
||||
name: /^Running 2 actions/,
|
||||
});
|
||||
const groupPanel = messagesView(page).getByTestId('tool-call-group-panel').last();
|
||||
await Promise.all([
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue