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
42 changes: 29 additions & 13 deletions gui/next/playwright/database.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -555,48 +555,64 @@ test('adding a record with broken array and expecting validation error', async (
});


test('editing a record', async ({ page }) => {
test('editing a record', async ({ page }, testInfo) => {
// Unique per attempt: a retry runs against the record the previous attempt left behind, and
// a value shared with it would match two cells and fail Playwright's strict mode.
const item = `new_array_item_3_${testInfo.retry}`;
const editedItem = `edited_array_item_3_${testInfo.retry}`;

await page.goto(url);

await page.getByText('qa_table_1').click();

await page.getByRole('button', { name: 'Create new record' }).click();
await page.getByLabel('qa_table_1_array').fill('["new_array_item_3", "new_array_item_4"]');
await page.getByLabel('qa_table_1_array').fill(`["${item}", "new_array_item_4"]`);

await page.getByRole('button', { name: 'Create record' }).click();

await expect(page.getByRole('cell', { name: '["new_array_item_3"' })).toBeVisible();
const createdCell = page.getByRole('cell', { name: `["${item}"` });
await expect(createdCell).toBeVisible();

await page.getByRole('button', { name: 'Edit record' }).first().click();
await page.getByLabel('qa_table_1_array').fill('["edited_array_item_3", "edited_array_item_4"]');
// Edit the row holding this test's own record, not the first row: records are listed newest
// first and the other workers create records in the same table, so between this create and
// the list refresh that follows it another test's record can take the top row.
await page.locator('tr', { has: createdCell }).getByRole('button', { name: 'Edit record' }).click();
await page.getByLabel('qa_table_1_array').fill(`["${editedItem}", "edited_array_item_4"]`);
const dialog = page.locator('dialog');
await dialog.getByRole('button', { name: 'Edit record' }).first().click();

await expect(page.getByRole('cell', { name: '["new_array_item_3"' })).toBeHidden();
await expect(page.getByRole('cell', { name: '["edited_array_item_3"' })).toBeVisible();
await expect(createdCell).toBeHidden();
await expect(page.getByRole('cell', { name: `["${editedItem}"` })).toBeVisible();
});


test('deleting a record', async ({ page }) => {
test('deleting a record', async ({ page }, testInfo) => {
page.on('dialog', async dialog => {
expect(dialog.message()).toEqual('Are you sure you want to delete this record?');
await dialog.accept();
});

// Unique per attempt, for the same reason as in 'editing a record' above.
const item = `to_be_deleted_array_${testInfo.retry}`;

await page.goto(url);
await page.getByText('qa_table_1').click();

await page.getByRole('button', { name: 'Create new record' }).click();
await page.getByLabel('qa_table_1_array').fill('["to_be_deleted_array"]');
await page.getByLabel('qa_table_1_array').fill(`["${item}"]`);

await page.getByRole('button', { name: 'Create record' }).click();

await expect(page.getByRole('cell', { name: '["to_be_deleted_array"' })).toBeVisible();
const createdCell = page.getByRole('cell', { name: `["${item}"` });
await expect(createdCell).toBeVisible();

await page.getByRole('button', { name: 'More options' }).first().click();
await page.getByRole('button', { name: 'Delete record' }).click();
// Delete the row holding this test's own record, not the first row: another test's record can
// take the top row while this one runs.
const createdRow = page.locator('tr', { has: createdCell });
await createdRow.getByRole('button', { name: 'More options' }).click();
await createdRow.getByRole('button', { name: 'Delete record' }).click();

await expect(page.getByRole('cell', { name: '["to_be_deleted_array"' })).toBeHidden();
await expect(createdCell).toBeHidden();
});


Expand Down
6 changes: 5 additions & 1 deletion lib/check.js
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,11 @@ const initConfig = async (rootPath) => {
// Create the initial config that extends recommended settings
const initConfig = {
extends: 'platformos-check:recommended',
ignore: ['node_modules/**']
// Bare name, not `node_modules/**`: since platformos-check 1.1.0 a slash-bearing
// pattern is anchored on the project root, so `node_modules/**` would stop covering
// a nested one (`modules/<name>/node_modules`). A bare name still matches at any
// depth, and covers the directory's contents as well as a file of that name.
ignore: ['node_modules']
};

const initConfigYml = YAML.stringify(initConfig);
Expand Down
131 changes: 66 additions & 65 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@
],
"dependencies": {
"@inquirer/prompts": "^8.7.0",
"@platformos/platformos-check-node": "^1.0.0",
"@platformos/platformos-common": "^0.1.0",
"@platformos/platformos-language-server-node": "^0.1.0",
"@platformos/platformos-mcp-supervisor": "^0.1.0",
"@platformos/platformos-check-node": "^1.1.0",
"@platformos/platformos-common": "^0.2.0",
"@platformos/platformos-language-server-node": "^0.1.1",
"@platformos/platformos-mcp-supervisor": "^0.2.0",
"ajv": "^8.20.0",
"ajv-formats": "^3.0.1",
"async": "^3.2.6",
Expand Down
2 changes: 1 addition & 1 deletion test/integration/check.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ describe('pos-cli check run', () => {
const configContent = fs.readFileSync(configPath, 'utf8');
expect(configContent).toMatch('extends: platformos-check:recommended');
expect(configContent).toMatch('ignore:');
expect(configContent).toMatch('- node_modules/**');
expect(configContent).toMatch('- node_modules');
expect(configContent).toMatch('# Below are all available settings');
} finally {
// Cleanup
Expand Down
Loading