gitoria

tracker

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commitc98e2043c98e2043log: T36A rollbackmrec98e2043/tests/person-index.hl

1.8 KB

  1. // tracker#62: native lookups preserve map winners and creation conflict suffixes.
  2. import { personsTable, showsTable } from '../lib/shows.hl'
  3. import { personBySlug, personIdByTmdb, castPersonId, guestPersonId } from '../lib/people.hl'
  4. static check = (Boolean ok, String message) => { if (!ok) { hlError(message) } }
  5. static run = () => {
  6. for (p of [
  7. { id = 'index-first' oldId = 'index-first' name = 'Same Name' urlSegment = 'Same-Name' tmdbId = 87650001 }
  8. { id = 'index-last' oldId = 'index-last' name = 'Same Name' urlSegment = 'Same-Name' tmdbId = 87650001 }
  9. { id = 'index-suffix' oldId = 'index-suffix' name = 'Same Name' urlSegment = 'Same-Name-2' tmdbId = 87650002 }
  10. ]) { check(personsTable.put(p) != null, 'seed') }
  11. check(personBySlug('Same-Name').id == 'index-last', 'last slug winner')
  12. check(personIdByTmdb(87650001) == 'index-last', 'last TMDB winner')
  13. check(personIdByTmdb('87650001') == 'index-last', 'TMDB string coercion')
  14. check(personBySlug('missing') == null && personBySlug('') == null && personBySlug(null) == null, 'absent slug')
  15. check(personIdByTmdb(87659999) == null, 'absent TMDB')
  16. c = { tmdbId = 87650003 name = 'Same Name' character = 'Role' }
  17. id = castPersonId(&c, null)
  18. check(id != null && personBySlug('Same-Name-3').id == id, 'conflict suffix')
  19. check(castPersonId(&c, null) == id, 'repeat cast import')
  20. check(guestPersonId(87650003, null).created == false, 'known guest')
  21. s = { id = 'index-show' oldId = 'index-show' cast = [{ tmdbId = 87650004 actor = 'Same Name' character = 'Guest' }] }
  22. check(showsTable.put(s) != null, 'guest show')
  23. g = guestPersonId(87650004, 'index-show')
  24. check(g.created && personBySlug('Same-Name-4').id == g.id, 'new guest')
  25. check(guestPersonId(87650004, 'index-show').created == false, 'guest revisit')
  26. check(personIdByTmdb(87650004) == g.id, 'new guest TMDB lookup')
  27. personsTable.persist()
  28. console.log('person-index: passed')
  29. return true
  30. }
  31. run()

Branches

Latest commits

  • c98e2043log: T36A rollbackmre
  • ae905f15Merge t36a: tracker#36 apply rechecks, reportmre
  • 796bfaceT36A: report validated fixes, failed live SSH check and verified rollbackmre
  • 55257852log: #53 live, #56 mergedmre
  • 78b39f1bMerge hm56-rows: tracker#56 list builders insert oncemre
  • 7aea52batmdb fix: protect owners without slugs and record passing gatesmre
  • 9b3c2559tmdb fix: revalidate planned identities and reserve target idsmre
  • 6da612fclog: T36A tool defectmre
  • d56ee0daT36A: report unsafe TMDB apply revalidation and stop before livemre
  • 08e55255log: HM56 done, T36A startedmre
  • 91bcdf0eAvoid per-row list copies and reproduce keyed-row blockersmre
  • 5fd2ac75status: #36 GOmre
  • 0d253b45mission: T36Amre
  • 2aa22d23log: #36 GOmre
  • 833aee2flog: #50 closed, HM56 startedmre
  • ac58c1e5mission: HM56mre
  • 58979c0clog: HM54 held for decision, DP65 startedmre
  • bb2ebc67log: #64 live, #53 mergedmre
  • 27cde42fMerge hm53-dom: tracker#53 inputs bound to membersmre
  • 2156cc7flog: HM54 reviewmre