fix(amazon-shopping): enforce rating filters in chat output

This commit is contained in:
2026-04-15 21:05:27 -05:00
parent fda0602ac9
commit b3875858c7
7 changed files with 53 additions and 32 deletions
+5 -3
View File
@@ -53,7 +53,7 @@ describe("report", () => {
assert.match(markdown, /https:\/\/www\.amazon\.com\/dp\/B0TEST0001/);
});
it("creates a table template with constraint status markers", () => {
it("creates a chat-safe template with direct product links and constraint status markers", () => {
const markdown = createMarkdownReport(createResponse({
query: "sofa bed beige",
filters: {
@@ -87,11 +87,13 @@ describe("report", () => {
}));
assert.match(markdown, /## Best Matches/);
assert.match(markdown, /\| # \| Product \| Price \| Rating \| Reviews \| Width \| Prime \| Delivery \| Link \|/);
assert.doesNotMatch(markdown, /\| # \| Product \| Price \| Rating \| Reviews \| Width \| Prime \| Delivery \| Link \|/);
assert.doesNotMatch(markdown, /\[Amazon\]\(https:\/\/www\.amazon\.com\/dp\/B0SOFABED1\)/);
assert.match(markdown, /HONBAY Modular Sectional Sleeper/);
assert.match(markdown, /Link: https:\/\/www\.amazon\.com\/dp\/B0SOFABED1/);
assert.match(markdown, /83\.4" OK/);
assert.match(markdown, /Prime OK/);
assert.match(markdown, /Tomorrow OK/);
assert.match(markdown, /\[Amazon\]\(https:\/\/www\.amazon\.com\/dp\/B0SOFABED1\)/);
assert.match(markdown, /Price: \$539\.99/);
});
});