test(environment): share tag rename responses (#17378)

This commit is contained in:
Vincent Koc
2026-12-06 12:00:02 +08:00
committed by GitHub
parent c88114c3a3
commit 83ba8166f9
+18 -49
View File
@@ -14,6 +14,18 @@ const SEED_TAGS = [
tag(2, "Tide Tables", "tide-tables", "2026-10-01T10:00:00Z"),
];
const lampOilDeliveries = () => ({
...SEED_TAGS[0]!,
name: "Lamp Oil Deliveries",
slug: "lamp-oil-deliveries",
});
const springTideTables = () => ({
...SEED_TAGS[1]!,
name: "Spring Tide Tables",
slug: "spring-tide-tables",
});
/** A tag as a create answers it: without the document count reads show, and with its clock to the nanosecond. */
const answered = (id: number, name: string, slug: string, at: number) => ({
id,
@@ -105,59 +117,20 @@ export const STALE_SLUG_ROWS: readonly TimedCaptureRow[] = [
[
"PUT",
"/api/tags/1",
{
...SEED_TAGS[0]!,
name: "Lamp Oil Deliveries",
slug: "lamp-oil-deliveries",
},
lampOilDeliveries(),
200,
{ ...SEED_TAGS[0]!, name: "Lamp Oil Deliveries" },
],
[
"GET",
"/api/tags/1",
{
...SEED_TAGS[0]!,
name: "Lamp Oil Deliveries",
slug: "lamp-oil-deliveries",
},
],
["GET", "/api/tags/1", lampOilDeliveries()],
[
"PUT",
"/api/tags/2",
{
...SEED_TAGS[1]!,
name: "Spring Tide Tables",
slug: "spring-tide-tables",
},
springTideTables(),
200,
{ ...SEED_TAGS[1]!, name: "Spring Tide Tables" },
],
[
"GET",
"/api/tags/2",
{
...SEED_TAGS[1]!,
name: "Spring Tide Tables",
slug: "spring-tide-tables",
},
],
[
"GET",
"/api/tags",
[
{
...SEED_TAGS[0]!,
name: "Lamp Oil Deliveries",
slug: "lamp-oil-deliveries",
},
{
...SEED_TAGS[1]!,
name: "Spring Tide Tables",
slug: "spring-tide-tables",
},
],
],
["GET", "/api/tags/2", springTideTables()],
["GET", "/api/tags", [lampOilDeliveries(), springTideTables()]],
];
const POST = {
@@ -207,11 +180,7 @@ export const slugSaveRows = (
customSlug = false,
): readonly TimedCaptureRow[] => {
const saved = { ...SEED_TAGS[0]!, ...(customSlug ? { slug: "custom" } : {}) };
const renamed = {
...SEED_TAGS[1]!,
name: "Spring Tide Tables",
slug: "spring-tide-tables",
};
const renamed = springTideTables();
const saves: TimedCaptureRow[][] = [
[
["PUT", "/api/tags/1", saved, 200, saved],