gitoria

tracker

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit5db849745db84974Log: Apollo window GO, AP56b started, BS1 copy removedmre5db84974/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

  • 5db84974Log: Apollo window GO, AP56b started, BS1 copy removedmre
  • e84586a7Mission AP56bmre
  • 15917f03Record PR workflow rule (gitoria#50)mre
  • 942ac995status: paused workers statemre
  • 44b934e5log: respawn cleanupmre
  • 03a80097Log: Anton GC A/Bmre
  • c7cdef62Log: Apollo STOP, workers pausedmre
  • d0c083fbLog: usage stopmre
  • c6d464e5Log: Apollo GO backlog, AP56 and BS1 startedmre
  • 1eb6f1a1Missions AP56, BS1mre
  • 4871f8adLog: AP52 live on day52, browser gate greenmre
  • d9bf2988Merge ap52: day52, tracker#58 server argument, #51 modal close rule, #56 keyed season rowsmre
  • c4a60ef2Log: RT52 retest passed, AP52 startedmre
  • 83760a55Browser gate: search results belong to the address form of the typed text (tracker#52 navigate replace)mre
  • 6e951d91AP52: show-page rows are keyed records; closing a season is one upsert and removes (tracker#56, hybriel#331)mre
  • 3bb4ccddAP52: modal close button refers to its nested rule with Style.buttonModalX (tracker#51, hybriel#333)mre
  • ba16933fAP52: login callback and title route are static handlers taking the server as third argument (tracker#58, hybriel#332)mre
  • 85153900AP52: re-vendor Hybriel set day52 (source 77cfca31, bin 0a8ed496)mre
  • 7c051eddLog: hybriel#338 answermre
  • d049b8b8Log: HM50 live, #52 donemre