Unverified 提交 b01f96f1 authored 作者: Will Chen's avatar Will Chen 提交者: GitHub

Fix e2e tests (#2103)

<!-- CURSOR_SUMMARY --> > [!NOTE] > Stabilizes e2e behavior and snapshots; adds fixtures and minor UI test hook. > > - **Snapshot determinism**: Normalize `dyad_options.versioned_files` fileIds to `[[FILE_ID_*]]` in `test_helper.ts` and apply during request dumps; refresh related snapshots > - **Token bar reliability**: Add `data-testid="token-bar-toggle"` in `AuxiliaryActionsMenu` and new `po.toggleTokenBar()` helper; update Supabase branch test > - **Version integrity tests**: Add fixture app (`version-integrity`) and new/updated tests + snapshots validating add/edit/delete/move and restore flow with explicit wait > - **Misc**: Update local agent snapshot to include `web_search` tool; bump `package-lock.json` to `0.33.0-beta.1` > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 1415ef1379a71bf6efe61da5079ff65dead84ba4. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Stabilizes e2e tests by making snapshot data deterministic and fixing races in token bar toggle and restore flows. Updates snapshots (including web_search) and adds a version-integrity app fixture; also adds a test id for reliable selectors. - **Bug Fixes** - Normalize versioned_files fileIds in dumps to deterministic placeholders before snapshotting. - Add data-testid="token-bar-toggle" and PageObject.toggleTokenBar() to avoid flakiness; update Supabase branch test to use it. - Refresh snapshots to reflect deterministic IDs and the web_search tool. - Add version-integrity import app fixture and snapshot coverage; wait for restore completion in version_integrity.spec to prevent flakiness. - **Dependencies** - Bump package-lock version to 0.33.0-beta.1. <sup>Written for commit 1415ef1379a71bf6efe61da5079ff65dead84ba4. Summary will update on new commits.</sup> <!-- End of auto-generated description by cubic. -->
上级 5acadeff
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
node_modules
dist
dist-ssr
*.local
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
{
"name": "vite_react_shadcn_ts",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"build:dev": "vite build --mode development",
"lint": "eslint .",
"preview": "vite preview"
},
"dependencies": {
"react": "^18.3.1",
"react-dom": "^18.3.1"
},
"devDependencies": {
"@types/node": "^22.5.5",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@vitejs/plugin-react-swc": "^3.9.0",
"typescript": "^5.5.3",
"vite": "^6.3.4"
}
}
......@@ -20,6 +20,60 @@ export const Timeout = {
MEDIUM: process.env.CI ? 30_000 : 15_000,
};
/**
* Normalizes fileId hashes in versioned_files to be deterministic.
* FileIds are SHA-256 hashes that may include non-deterministic components
* like app paths with timestamps. This replaces them with stable placeholders
* based on content sorting.
*/
function normalizeVersionedFiles(dump: any): void {
const vf = dump?.body?.dyad_options?.versioned_files;
if (!vf?.fileIdToContent) {
return;
}
const fileIdToContent = vf.fileIdToContent as Record<string, string>;
// Create mapping from old fileId to new deterministic fileId
// Sort by content to ensure deterministic ordering
const entries = Object.entries(fileIdToContent).sort((a, b) =>
String(a[1]).localeCompare(String(b[1])),
);
const oldToNewId: Record<string, string> = {};
const newFileIdToContent: Record<string, string> = {};
entries.forEach(([oldId, content], index) => {
const newId = `[[FILE_ID_${index}]]`;
oldToNewId[oldId] = newId;
newFileIdToContent[newId] = content;
});
vf.fileIdToContent = newFileIdToContent;
// Update fileReferences
if (vf.fileReferences) {
vf.fileReferences = vf.fileReferences.map((ref: any) => ({
...ref,
fileId: oldToNewId[ref.fileId] ?? ref.fileId,
}));
}
// Update messageIndexToFilePathToFileId
if (vf.messageIndexToFilePathToFileId) {
for (const pathToId of Object.values(
vf.messageIndexToFilePathToFileId as Record<
string,
Record<string, string>
>,
)) {
for (const [filePath, id] of Object.entries(pathToId)) {
pathToId[filePath] = oldToNewId[id] ?? id;
}
}
}
}
export class ContextFilesPickerDialog {
constructor(
public page: Page,
......@@ -734,6 +788,8 @@ export class PageObject {
return message;
},
);
// Normalize fileIds to be deterministic based on content
normalizeVersionedFiles(parsedDump);
expect(
JSON.stringify(parsedDump, null, 2).replace(/\\r\\n/g, "\\n"),
).toMatchSnapshot(name);
......@@ -794,6 +850,16 @@ export class PageObject {
await this.page.getByRole("button", { name: "Back" }).click();
}
async toggleTokenBar() {
// Need to make sure it's NOT visible yet to avoid a race when we opened
// the auxiliary actions menu earlier.
await expect(this.page.getByTestId("token-bar-toggle")).not.toBeVisible();
await this.getChatInputContainer()
.getByTestId("auxiliary-actions-menu")
.click();
await this.page.getByTestId("token-bar-toggle").click();
}
async sendPrompt(
prompt: string,
{ skipWaitForCompletion = false }: { skipWaitForCompletion?: boolean } = {},
......
......@@ -22,96 +22,96 @@
"dyad_options": {
"versioned_files": {
"fileIdToContent": {
"fd0f9b44a8d543177b124c3b9b5e62da7d0e2683379352e9e2c587d285c36686": "// File contents excluded from context",
"27c40a1c2df213eb19562166c763e05c3b7f5107445e39005cfc452f521c66d3": "// a.ts\n",
"b994bc3c3d3943db57855232d61fbc1ae6b4ce3f9847bb512c9a55f5ba089502": "# AI_RULES.md\n",
"76d20807a244c4f18ab58337e44f961ae397b2c844b538af9c7bcf64a3d07c8f": "// exclude.ts: this file is not in any of the globs\n",
"eb844b26f375fa895c77d30eeea5d5d7135d9658eaa731a396faf6b504652018": "// exclude.tsx: this file is not in any of the globs\n",
"f14173ab2694d5fd20f5b010df975a1a13dbca937408e5f5674acd99b81b1c82": "[\"even json is included\"]\n",
"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855": "",
"76307ff927a50b09155f802e4443bdbcdc1d8e10eec968c1d14776f001ba2481": "// button.tsx\n",
"9ab36ced71e4350acb4d0ee6eac6f61ccb785050a5c9eb62a8c6bbfab9fcbbc4": "// helper.ts\n",
"8ff2c0d1080114e4edba454b89f0d0912a11e60672b0d3b9ad964fd0c0ed3615": "/* some.css */\n",
"69ca7e5750668e215f1a792ba7612d74a6f5d634ecd2f6e575c2b62377563dae": "// foo.ts\n",
"0c5c20017d0aef7115d00715e4b5ab5a8b545eddfa3e981b0161bcd006902414": "// sub/sub1.ts\n",
"27bce07ded1e6a9fce868247aa4dc4e4389cf0b8c810474992dc46f52638a8e9": "// sub/sub2.tsx\n",
"64f67386de21966eef1092306303e8b98fe6df81bc265933e1b6650358d80f9d": "// very-large-file.ts\n\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n"
"[[FILE_ID_0]]": "",
"[[FILE_ID_1]]": "[\"even json is included\"]\n",
"[[FILE_ID_2]]": "/* some.css */\n",
"[[FILE_ID_3]]": "// a.ts\n",
"[[FILE_ID_4]]": "// button.tsx\n",
"[[FILE_ID_5]]": "// exclude.ts: this file is not in any of the globs\n",
"[[FILE_ID_6]]": "// exclude.tsx: this file is not in any of the globs\n",
"[[FILE_ID_7]]": "// File contents excluded from context",
"[[FILE_ID_8]]": "// foo.ts\n",
"[[FILE_ID_9]]": "// helper.ts\n",
"[[FILE_ID_10]]": "// sub/sub1.ts\n",
"[[FILE_ID_11]]": "// sub/sub2.tsx\n",
"[[FILE_ID_12]]": "// very-large-file.ts\n\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n",
"[[FILE_ID_13]]": "# AI_RULES.md\n"
},
"fileReferences": [
{
"path": ".env.foobar",
"force": false,
"fileId": "fd0f9b44a8d543177b124c3b9b5e62da7d0e2683379352e9e2c587d285c36686"
"fileId": "[[FILE_ID_7]]"
},
{
"path": "a.ts",
"force": true,
"fileId": "27c40a1c2df213eb19562166c763e05c3b7f5107445e39005cfc452f521c66d3"
"fileId": "[[FILE_ID_3]]"
},
{
"path": "AI_RULES.md",
"force": false,
"fileId": "b994bc3c3d3943db57855232d61fbc1ae6b4ce3f9847bb512c9a55f5ba089502"
"fileId": "[[FILE_ID_13]]"
},
{
"path": "exclude/exclude.ts",
"force": false,
"fileId": "76d20807a244c4f18ab58337e44f961ae397b2c844b538af9c7bcf64a3d07c8f"
"fileId": "[[FILE_ID_5]]"
},
{
"path": "exclude/exclude.tsx",
"force": false,
"fileId": "eb844b26f375fa895c77d30eeea5d5d7135d9658eaa731a396faf6b504652018"
"fileId": "[[FILE_ID_6]]"
},
{
"path": "manual/baz.json",
"force": true,
"fileId": "f14173ab2694d5fd20f5b010df975a1a13dbca937408e5f5674acd99b81b1c82"
"fileId": "[[FILE_ID_1]]"
},
{
"path": "manual/file.ts",
"force": true,
"fileId": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
"fileId": "[[FILE_ID_0]]"
},
{
"path": "manual/sub-manual/sub-manual.js",
"force": true,
"fileId": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
"fileId": "[[FILE_ID_0]]"
},
{
"path": "src/components/ui/button.tsx",
"force": false,
"fileId": "76307ff927a50b09155f802e4443bdbcdc1d8e10eec968c1d14776f001ba2481"
"fileId": "[[FILE_ID_4]]"
},
{
"path": "src/components/ui/helper.ts",
"force": false,
"fileId": "9ab36ced71e4350acb4d0ee6eac6f61ccb785050a5c9eb62a8c6bbfab9fcbbc4"
"fileId": "[[FILE_ID_9]]"
},
{
"path": "src/dir/some.css",
"force": false,
"fileId": "8ff2c0d1080114e4edba454b89f0d0912a11e60672b0d3b9ad964fd0c0ed3615"
"fileId": "[[FILE_ID_2]]"
},
{
"path": "src/foo.ts",
"force": false,
"fileId": "69ca7e5750668e215f1a792ba7612d74a6f5d634ecd2f6e575c2b62377563dae"
"fileId": "[[FILE_ID_8]]"
},
{
"path": "src/sub/sub1.ts",
"force": false,
"fileId": "0c5c20017d0aef7115d00715e4b5ab5a8b545eddfa3e981b0161bcd006902414"
"fileId": "[[FILE_ID_10]]"
},
{
"path": "src/sub/sub2.tsx",
"force": false,
"fileId": "27bce07ded1e6a9fce868247aa4dc4e4389cf0b8c810474992dc46f52638a8e9"
"fileId": "[[FILE_ID_11]]"
},
{
"path": "src/very-large-file.ts",
"force": false,
"fileId": "64f67386de21966eef1092306303e8b98fe6df81bc265933e1b6650358d80f9d"
"fileId": "[[FILE_ID_12]]"
}
],
"messageIndexToFilePathToFileId": {
......
......@@ -22,60 +22,60 @@
"dyad_options": {
"versioned_files": {
"fileIdToContent": {
"27c40a1c2df213eb19562166c763e05c3b7f5107445e39005cfc452f521c66d3": "// a.ts\n",
"f14173ab2694d5fd20f5b010df975a1a13dbca937408e5f5674acd99b81b1c82": "[\"even json is included\"]\n",
"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855": "",
"9ab36ced71e4350acb4d0ee6eac6f61ccb785050a5c9eb62a8c6bbfab9fcbbc4": "// helper.ts\n",
"69ca7e5750668e215f1a792ba7612d74a6f5d634ecd2f6e575c2b62377563dae": "// foo.ts\n",
"0c5c20017d0aef7115d00715e4b5ab5a8b545eddfa3e981b0161bcd006902414": "// sub/sub1.ts\n",
"27bce07ded1e6a9fce868247aa4dc4e4389cf0b8c810474992dc46f52638a8e9": "// sub/sub2.tsx\n",
"64f67386de21966eef1092306303e8b98fe6df81bc265933e1b6650358d80f9d": "// very-large-file.ts\n\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n"
"[[FILE_ID_0]]": "",
"[[FILE_ID_1]]": "[\"even json is included\"]\n",
"[[FILE_ID_2]]": "// a.ts\n",
"[[FILE_ID_3]]": "// foo.ts\n",
"[[FILE_ID_4]]": "// helper.ts\n",
"[[FILE_ID_5]]": "// sub/sub1.ts\n",
"[[FILE_ID_6]]": "// sub/sub2.tsx\n",
"[[FILE_ID_7]]": "// very-large-file.ts\n\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n// 1234567890\n"
},
"fileReferences": [
{
"path": "a.ts",
"force": true,
"fileId": "27c40a1c2df213eb19562166c763e05c3b7f5107445e39005cfc452f521c66d3"
"fileId": "[[FILE_ID_2]]"
},
{
"path": "manual/baz.json",
"force": true,
"fileId": "f14173ab2694d5fd20f5b010df975a1a13dbca937408e5f5674acd99b81b1c82"
"fileId": "[[FILE_ID_1]]"
},
{
"path": "manual/file.ts",
"force": true,
"fileId": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
"fileId": "[[FILE_ID_0]]"
},
{
"path": "manual/sub-manual/sub-manual.js",
"force": true,
"fileId": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
"fileId": "[[FILE_ID_0]]"
},
{
"path": "src/components/ui/helper.ts",
"force": false,
"fileId": "9ab36ced71e4350acb4d0ee6eac6f61ccb785050a5c9eb62a8c6bbfab9fcbbc4"
"fileId": "[[FILE_ID_4]]"
},
{
"path": "src/foo.ts",
"force": false,
"fileId": "69ca7e5750668e215f1a792ba7612d74a6f5d634ecd2f6e575c2b62377563dae"
"fileId": "[[FILE_ID_3]]"
},
{
"path": "src/sub/sub1.ts",
"force": false,
"fileId": "0c5c20017d0aef7115d00715e4b5ab5a8b545eddfa3e981b0161bcd006902414"
"fileId": "[[FILE_ID_5]]"
},
{
"path": "src/sub/sub2.tsx",
"force": false,
"fileId": "27bce07ded1e6a9fce868247aa4dc4e4389cf0b8c810474992dc46f52638a8e9"
"fileId": "[[FILE_ID_6]]"
},
{
"path": "src/very-large-file.ts",
"force": false,
"fileId": "64f67386de21966eef1092306303e8b98fe6df81bc265933e1b6650358d80f9d"
"fileId": "[[FILE_ID_7]]"
}
],
"messageIndexToFilePathToFileId": {
......
......@@ -236,6 +236,27 @@
"$schema": "http://json-schema.org/draft-07/schema#"
}
}
},
{
"type": "function",
"function": {
"name": "web_search",
"description": "\nUse this tool to access real-time information beyond your training data cutoff.\n\nWhen to Search:\n- Current API documentation, library versions, or breaking changes\n- Latest best practices, security advisories, or bug fixes\n- Specific error messages or troubleshooting solutions\n- Recent framework updates or deprecation notices\n\nQuery Tips:\n- Be specific: Include version numbers, exact error messages, or technical terms\n- Add context: \"React 19 useEffect cleanup\" not just \"React hooks\"\n\nExamples:\n\n<example>\nOpenAI GPT-5 API model names\n</example>\n\n<example>\nNextJS 14 app router middleware auth\n</example>\n",
"parameters": {
"type": "object",
"properties": {
"query": {
"type": "string",
"description": "The search query to look up on the web"
}
},
"required": [
"query"
],
"additionalProperties": false,
"$schema": "http://json-schema.org/draft-07/schema#"
}
}
}
],
"tool_choice": "auto",
......
=== .gitignore ===
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
node_modules
dist
dist-ssr
*.local
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
=== a.txt ===
a
......@@ -11,6 +38,34 @@ b
=== dir/c.txt ===
dir/c.txt
=== package.json ===
{
"name": "vite_react_shadcn_ts",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"build:dev": "vite build --mode development",
"lint": "eslint .",
"preview": "vite preview"
},
"dependencies": {
"react": "^18.3.1",
"react-dom": "^18.3.1"
},
"devDependencies": {
"@types/node": "^22.5.5",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@vitejs/plugin-react-swc": "^3.9.0",
"typescript": "^5.5.3",
"vite": "^6.3.4"
},
"packageManager": "<scrubbed>"
}
=== to-be-deleted.txt ===
this file should be deleted
......
=== .gitignore ===
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
node_modules
dist
dist-ssr
*.local
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
=== a.txt ===
a
......@@ -15,5 +42,33 @@ dir/c.txt
new-file
end of new-file
=== package.json ===
{
"name": "vite_react_shadcn_ts",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"build:dev": "vite build --mode development",
"lint": "eslint .",
"preview": "vite preview"
},
"dependencies": {
"react": "^18.3.1",
"react-dom": "^18.3.1"
},
"devDependencies": {
"@types/node": "^22.5.5",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@vitejs/plugin-react-swc": "^3.9.0",
"typescript": "^5.5.3",
"vite": "^6.3.4"
},
"packageManager": "<scrubbed>"
}
=== to-be-edited.txt ===
after-edit
\ No newline at end of file
=== .gitignore ===
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
node_modules
dist
dist-ssr
*.local
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
=== a.txt ===
a
......@@ -15,5 +42,33 @@ dir/c.txt
new-file
end of new-file
=== package.json ===
{
"name": "vite_react_shadcn_ts",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"build:dev": "vite build --mode development",
"lint": "eslint .",
"preview": "vite preview"
},
"dependencies": {
"react": "^18.3.1",
"react-dom": "^18.3.1"
},
"devDependencies": {
"@types/node": "^22.5.5",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@vitejs/plugin-react-swc": "^3.9.0",
"typescript": "^5.5.3",
"vite": "^6.3.4"
},
"packageManager": "<scrubbed>"
}
=== to-be-edited.txt ===
after-edit
\ No newline at end of file
......@@ -10,11 +10,11 @@ testSkipIfWindows("supabase branch selection works", async ({ po }) => {
await po.page.getByText("Set up supabase").click();
await po.clickConnectSupabaseButton();
await po.clickBackButton();
await po.page.getByTestId("token-bar-toggle").click();
await po.toggleTokenBar();
// The default branch has a small context.
await expect(po.page.getByTestId("token-bar")).toContainText("6% of 128K");
// We hide the token bar so we re-open it later to refresh the token count.
await po.page.getByTestId("token-bar-toggle").click();
await po.toggleTokenBar();
await po.getTitleBarAppNameButton().click();
await po.page.getByTestId("supabase-branch-select").click();
......@@ -23,6 +23,6 @@ testSkipIfWindows("supabase branch selection works", async ({ po }) => {
await po.clickBackButton();
// The test branch has a large context (200k tokens) so it'll hit the 100% limit.
// This is to make sure we're connecting to the right supabase project for the branch.
await po.page.getByTestId("token-bar-toggle").click();
await po.toggleTokenBar();
await expect(po.page.getByTestId("token-bar")).toContainText("100% of 128K");
});
import { PageObject, testSkipIfWindows } from "./helpers/test_helper";
import { PageObject, testSkipIfWindows, Timeout } from "./helpers/test_helper";
import { expect } from "@playwright/test";
import * as eph from "electron-playwright-helpers";
import path from "node:path";
......@@ -37,9 +37,11 @@ const runVersionIntegrityTest = async (po: PageObject, nativeGit: boolean) => {
await po.page.getByText("Init Dyad app Restore").click();
await po.snapshotAppFiles({ name: "v1" });
await po.page
.getByRole("button", { name: "Restore to this version" })
.click();
const restoreButton = po.page.getByRole("button", {
name: "Restore to this version",
});
await restoreButton.click();
await expect(restoreButton).not.toBeVisible({ timeout: Timeout.LONG });
// Should be same as the previous snapshot, but just to be sure.
await po.snapshotAppFiles({ name: "v1" });
};
......
{
"name": "dyad",
"version": "0.32.0-beta.1",
"version": "0.33.0-beta.1",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "dyad",
"version": "0.32.0-beta.1",
"version": "0.33.0-beta.1",
"license": "MIT",
"dependencies": {
"@ai-sdk/amazon-bedrock": "^3.0.15",
......
......@@ -72,6 +72,7 @@ export function AuxiliaryActionsMenu({
<DropdownMenuItem
onClick={toggleShowTokenBar}
className={`py-2 px-3 group ${showTokenBar ? "bg-primary/10 text-primary" : ""}`}
data-testid="token-bar-toggle"
>
<ChartColumnIncreasing
size={16}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论