From cd8e2bb80dd77af8f2fd547f001f90d256658f5f Mon Sep 17 00:00:00 2001 From: Jeongho Nam Date: Tue, 4 Feb 2025 01:50:41 +0900 Subject: [PATCH] Fix test program description validator --- .../test_http_migrate_route_comment.ts | 28 +++++-------------- 1 file changed, 7 insertions(+), 21 deletions(-) diff --git a/test/features/migrate/test_http_migrate_route_comment.ts b/test/features/migrate/test_http_migrate_route_comment.ts index 020e43d..f066b7a 100644 --- a/test/features/migrate/test_http_migrate_route_comment.ts +++ b/test/features/migrate/test_http_migrate_route_comment.ts @@ -22,25 +22,11 @@ export const test_http_migrate_route_comment = async (): Promise => { const route: IHttpMigrateRoute | undefined = migrate.routes.find( (r) => r.path === "/shoppings/sellers/sales/{id}" && r.method === "put", ); - TestValidator.equals("comment")(route?.comment())(EXPECTED); + TestValidator.predicate("comment")( + () => + !!route?.comment()?.startsWith("Update a sale.") && + !!route + ?.comment() + ?.includes("Update a {@link IShoppingSale sale} with new information"), + ); }; - -const EXPECTED = `Update a sale. - -Update a {@link IShoppingSale sale} with new information. - -By the way, the sale actually does not being modified, but just make a new -{@link IShoppingSaleSnapshot snapshot} record of the sale. Its 1st purpose -is to keeping the integrity of the sale, due to modification of the sale -must not affect to the {@link IShoppingOrder orders} that already had been -applied to the sale. - -The 2nd purpose is for the A/B tests. {@link IShoppingSeller Seller} needs -to demonstrate operating performance by chaining price, content, and -composition of the product. This snapshot concept would be helpful for it. - -@param id Target sale's {@link IShoppingSale.id } -@param body New information of the sale\n@security bearer -@tag Sale` - .split("\r\n") - .join("\n");