feat(housekeeping): cut over administration to ase
This commit is contained in:
@@ -136,7 +136,7 @@ beforeEach(() => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("Content legacy wrappers", () => {
|
||||
describe("Content compatibility wrappers", () => {
|
||||
it("delegates article creation and preserves redirect ordering", async () => {
|
||||
await createArticle(
|
||||
form({
|
||||
@@ -151,7 +151,7 @@ describe("Content legacy wrappers", () => {
|
||||
"article.change",
|
||||
expect.objectContaining({ action: "create", title: "Launch" }),
|
||||
);
|
||||
expect(redirect).toHaveBeenCalledWith("/admin/articles");
|
||||
expect(redirect).toHaveBeenCalledWith("/ase/content/editorial/articles");
|
||||
});
|
||||
|
||||
it("delegates ad creation and keeps the legacy void/redirect contract", async () => {
|
||||
@@ -165,7 +165,7 @@ describe("Content legacy wrappers", () => {
|
||||
"ad.change",
|
||||
expect.objectContaining({ action: "create" }),
|
||||
);
|
||||
expect(redirect).toHaveBeenCalledWith("/admin/ads");
|
||||
expect(redirect).toHaveBeenCalledWith("/ase/content/media/ads");
|
||||
});
|
||||
|
||||
it("delegates media and favicon uploads while retaining public result shapes", async () => {
|
||||
@@ -308,22 +308,14 @@ describe("Content legacy wrappers", () => {
|
||||
for (const path of [
|
||||
"src/actions/admin-ads.ts",
|
||||
"src/actions/admin-articles.ts",
|
||||
"src/actions/admin-banners.ts",
|
||||
"src/actions/admin-email-templates.ts",
|
||||
"src/actions/admin-help.ts",
|
||||
"src/actions/admin-media.ts",
|
||||
"src/actions/admin-nav-menu.ts",
|
||||
"src/actions/admin-photos.ts",
|
||||
"src/actions/admin-tags.ts",
|
||||
"src/actions/admin-theme.ts",
|
||||
"src/actions/admin-writeable-boxes.ts",
|
||||
"src/actions/banners.ts",
|
||||
"src/actions/events.ts",
|
||||
"src/actions/polls.ts",
|
||||
"src/actions/prefixes.ts",
|
||||
"src/actions/save-favicon.ts",
|
||||
"src/actions/save-logo.ts",
|
||||
"src/actions/translations.ts",
|
||||
"src/actions/emulator.ts",
|
||||
]) {
|
||||
const source = readFileSync(path, "utf8");
|
||||
@@ -335,21 +327,4 @@ describe("Content legacy wrappers", () => {
|
||||
).toBe(true);
|
||||
}
|
||||
});
|
||||
|
||||
it("routes the real banner manager through the required compatibility action", () => {
|
||||
const source = readFileSync(
|
||||
"src/app/admin/banners/banners-manager.tsx",
|
||||
"utf8",
|
||||
);
|
||||
expect(source).toContain('from "@/actions/admin-banners"');
|
||||
expect(source).not.toContain('from "@/actions/banners"');
|
||||
});
|
||||
|
||||
it("exports explicit async banner wrappers accepted by Next server actions", () => {
|
||||
const source = readFileSync("src/actions/admin-banners.ts", "utf8");
|
||||
expect(source).not.toMatch(/export\s*\{/u);
|
||||
for (const action of ["createBanner", "updateBanner", "deleteBanner"]) {
|
||||
expect(source).toContain(`export async function ${action}`);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user