mirror of
https://github.com/webstudio-is/webstudio.git
synced 2026-10-29 08:07:48 +09:00
**Summary** Fixes content-mode edit permissions so editor-only users can perform allowed content workflows without backend “build permission” failures. **Changes** - Added shared content-mode permission validation used by backend authorization. - Aligned content-mode capabilities around editable props, editable instances, content roots, pages, assets, and template insertion. - Allowed content-safe instance/text/page/template/style changes while keeping design/data/resource changes build-only. - Updated template insertion to preserve content-safe local styles and reuse tokens by id. - Added accessible `SyncStatusDot` for e2e-visible sync state without replacing the existing sync status UI. - Added builder e2e setup with Postgres/PostgREST and a first content-mode browser test: - edit existing text as an editor-only user - wait for saved state via the sync status dot - reload and verify persistence **Verification** - `pnpm --filter=@webstudio-is/builder test -- sync-status.test.tsx` - `pnpm --filter=@webstudio-is/builder typecheck` - `git diff --check` - `pnpm e2e:builder`
27 lines
530 B
TypeScript
27 lines
530 B
TypeScript
import type { Locator, Page } from "playwright";
|
|
|
|
export const expectLocatorHidden = async ({
|
|
locator,
|
|
message,
|
|
}: {
|
|
locator: Locator;
|
|
message: string;
|
|
}) => {
|
|
if (await locator.isVisible({ timeout: 1_000 }).catch(() => false)) {
|
|
throw new Error(message);
|
|
}
|
|
};
|
|
|
|
export const expectTextHidden = async ({
|
|
page,
|
|
text,
|
|
}: {
|
|
page: Page;
|
|
text: string;
|
|
}) => {
|
|
await expectLocatorHidden({
|
|
locator: page.getByText(text, { exact: true }).first(),
|
|
message: `Expected text "${text}" to be hidden`,
|
|
});
|
|
};
|