fix(pricing): test fixes and post-merge tooling
Some checks are pending
Some checks are pending
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
2984185e6b
commit
c6cc637f8a
5 changed files with 43 additions and 8 deletions
|
|
@ -119,6 +119,7 @@ export default function CardDetailPurchaseTab({
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div data-testid="card-detail-local-stores-slot">
|
||||||
<CardDetailLocalStores
|
<CardDetailLocalStores
|
||||||
stores={nearbyStores}
|
stores={nearbyStores}
|
||||||
loading={nearbyStoresLoading}
|
loading={nearbyStoresLoading}
|
||||||
|
|
@ -126,5 +127,6 @@ export default function CardDetailPurchaseTab({
|
||||||
noHomeZip={nearbyStoresNoHomeZip}
|
noHomeZip={nearbyStoresNoHomeZip}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@
|
||||||
"backfill-embeddings": "node --env-file=.env.local scripts/backfill-card-embeddings.js",
|
"backfill-embeddings": "node --env-file=.env.local scripts/backfill-card-embeddings.js",
|
||||||
"migrate-neon-to-homelab": "node --env-file=.env.local scripts/migrate-neon-to-homelab.js",
|
"migrate-neon-to-homelab": "node --env-file=.env.local scripts/migrate-neon-to-homelab.js",
|
||||||
"fix-pricing-pgmigration-order": "node --env-file=.env.local scripts/fix-pricing-pgmigration-order.js",
|
"fix-pricing-pgmigration-order": "node --env-file=.env.local scripts/fix-pricing-pgmigration-order.js",
|
||||||
|
"sync-catalog-unified": "node --env-file=.env.local scripts/run-unified-catalog-sync.js",
|
||||||
"import-tags": "node --env-file=.env.local scripts/import-scryfall-tags.js",
|
"import-tags": "node --env-file=.env.local scripts/import-scryfall-tags.js",
|
||||||
"test": "vitest",
|
"test": "vitest",
|
||||||
"test:run": "vitest run",
|
"test:run": "vitest run",
|
||||||
|
|
|
||||||
32
scripts/run-unified-catalog-sync.js
Normal file
32
scripts/run-unified-catalog-sync.js
Normal file
|
|
@ -0,0 +1,32 @@
|
||||||
|
#!/usr/bin/env node
|
||||||
|
/**
|
||||||
|
* Run MTG + Pokémon + Lorcana bulk syncs (with pricing ingest) against POSTGRES_URL.
|
||||||
|
*
|
||||||
|
* Usage:
|
||||||
|
* node --env-file=.env.local scripts/run-unified-catalog-sync.js
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { runUnifiedCatalogSync } from '../lib/card-import/sync-catalog.js';
|
||||||
|
import { closeSqlPool } from '../lib/sql.js';
|
||||||
|
|
||||||
|
async function main() {
|
||||||
|
const summary = await runUnifiedCatalogSync();
|
||||||
|
console.log(JSON.stringify(summary, null, 2));
|
||||||
|
|
||||||
|
if (summary.errors?.length) {
|
||||||
|
process.exitCode = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
main()
|
||||||
|
.catch((err) => {
|
||||||
|
console.error(err);
|
||||||
|
process.exitCode = 1;
|
||||||
|
})
|
||||||
|
.finally(async () => {
|
||||||
|
try {
|
||||||
|
await closeSqlPool();
|
||||||
|
} catch {
|
||||||
|
// ignore
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
@ -66,7 +66,7 @@ describe('enrichLorcanaRowWithFolio', () => {
|
||||||
stats
|
stats
|
||||||
);
|
);
|
||||||
|
|
||||||
expect(enriched.currentPrice).toBeNull();
|
expect(enriched.currentPrice ?? null).toBeNull();
|
||||||
expect(stats.unmatchedCount).toBe(1);
|
expect(stats.unmatchedCount).toBe(1);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ describe('foolio-client', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('uses default Foilio feed URL', () => {
|
it('uses default Foilio feed URL', () => {
|
||||||
expect(getFolioFeedUrl()).toBe('https://foolio.net/api/prices/feed?game=lorcana');
|
expect(getFolioFeedUrl()).toBe('https://foilio.net/api/prices/feed?game=lorcana');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('prefers USD fields when parsing feed rows', () => {
|
it('prefers USD fields when parsing feed rows', () => {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue