gitoria

tracker

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit7f04de337f04de33log: HM49Bmre7f04de33/tests/people-order.hl

1.8 KB

  1. // HM61: stable ties, repeated physical rows, paging, updates, and the photo snapshot.
  2. import { personsTable } from '../lib/shows.hl'
  3. import { noteViewRow, finishPeopleView, peoplePage, personTouched, peopleCount, photoQueueStart, photoQueueStep } from '../lib/people.hl'
  4. static seed = () => {
  5. let i = 0
  6. while (i < 63) {
  7. id = 'order-person-' + i
  8. p = { id = id name = 'Order ' + i urlSegment = 'order-' + i updatedAt = i < 30 ? 0 : (i < 50 ? 100 : 200) tmdbId = 70000000 + i oldId = id }
  9. personsTable.put(p)
  10. noteViewRow(&p)
  11. if (i == 5) { noteViewRow(&p) }
  12. i = i + 1
  13. }
  14. finishPeopleView()
  15. return true
  16. }
  17. static dump = (String label) => {
  18. if (peopleCount() != 64) { hlError(label + ': expected 64 entries') }
  19. console.log(label + ' count=' + peopleCount())
  20. for (page of ['1', '2', '3', '4', '0', '-1', 'bad']) {
  21. r = peoplePage(&page)
  22. out = []
  23. for (t of r.tiles) { out.push(t.href) }
  24. if (r.pages != 3 || r.tiles.length != (r.page == 3 ? 16 : 24)) { hlError(label + ': incorrect paging') }
  25. if (r.page == 1 && r.tiles[0].href != (label == 'initial' ? '/person/order-62' : '/person/order-new')) { hlError(label + ': incorrect first entry') }
  26. console.log(label + ' raw=' + page + ' page=' + r.page + ' pages=' + r.pages + ' ' + JSON.stringify(out))
  27. }
  28. return true
  29. }
  30. static run = () => {
  31. seed()
  32. dump('initial')
  33. c = photoQueueStart()
  34. personTouched('order-person-5')
  35. personTouched('order-person-12')
  36. personTouched('order-person-5')
  37. p = { id = 'new-order-person' name = 'New' urlSegment = 'order-new' tmdbId = 70009999 oldId = 'new-order-person' }
  38. personsTable.put(p)
  39. personTouched(&p.id)
  40. dump('updated')
  41. dump('revisit')
  42. while (!photoQueueStep(&c)) { }
  43. if (c.out.length != 64 || c.out[0] != 'order-person-62' || c.out[57] != 'order-person-5' || c.out[58] != 'order-person-5') { hlError('photo snapshot changed') }
  44. console.log('snapshot ' + JSON.stringify(c.out))
  45. return true
  46. }
  47. run()

Branches

Latest commits

  • 7f04de33log: HM49Bmre
  • 00616cf3log: #49 batch merged, DP67 startedmre
  • d7232e86Merge hm49-styles: tracker#49 first batch of component stylesmre
  • 079f376dMove seven components' styles into Style blocksmre
  • 17d66feelog: #58 mergedmre
  • 69a6640bMerge hm58-map: tracker#58 project.hl only the mapmre
  • a85f7900Move route logic out of the project mapmre
  • 13dea5belog: #56 live, HM49 and HM58 startedmre
  • a31c8f2fdocs: tracker#36 remaining listmre
  • 975d06d1log: #36 live, DP66 startedmre
  • d6d03fa3mission: T36Bmre
  • e7512d00status: #36 rolled back, retry askedmre
  • 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