fix(watchlist): preserve prev country when TMDB tv lacks production_countries
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
e0e0462836
commit
a5ebb6f088
2 changed files with 31 additions and 1 deletions
|
|
@ -146,6 +146,23 @@ describe('TV country derivation', () => {
|
|||
const r = buildRecord(noProdCountries, false, EMPTY_PREV);
|
||||
expect(r.country).toBe('US');
|
||||
});
|
||||
test('TV no production_countries, prev full country name → preserves prev', () => {
|
||||
const { production_countries, ...noProdCountries } = tvDetail as any;
|
||||
const prev = { country: 'United States of America' };
|
||||
const r = buildRecord(noProdCountries, false, prev);
|
||||
expect(r.country).toBe('United States of America');
|
||||
});
|
||||
test('TV no production_countries, prev bare ISO code → uses origin_country fallback', () => {
|
||||
const { production_countries, ...noProdCountries } = tvDetail as any;
|
||||
const prev = { country: 'US' };
|
||||
const r = buildRecord(noProdCountries, false, prev);
|
||||
expect(r.country).toBe('US');
|
||||
});
|
||||
test('TV production_countries present, prev differs → uses production_countries name', () => {
|
||||
const prev = { country: 'Canada' };
|
||||
const r = buildRecord(tvDetail, false, prev);
|
||||
expect(r.country).toBe('United States of America');
|
||||
});
|
||||
});
|
||||
|
||||
describe('tmdb_rating rounding', () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue