gitoria

tickets

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Main branchmain5d144817Merge branch 'records-t40' into mainTicketsmain/tests/purge94-seed.hl

3.0 KB

  1. // tests/purge94-seed.hl — the fixture of tests/purge94.mjs (mission 028, #94, identity rule): an EMPTY store (TICKETS_STORAGE,
  2. // TICKETS_ATTACHMENTS absolute) gets a FAKE project miserit-anthar with 94 tickets (no real data), and on #94: comments with files, an edit,
  3. // a comment edit + a comment deletion, a like, an assignment, a state note, relations to and from other tickets (#93 parent, #10 blocker, #30 child,
  4. // #50 blocked by it) and a subscription made at #90 (its cursor lies before #94's rows). Control rows live on other tickets and in a second project. Prints one JSON line.
  5. import { ensureUser, setUserName, createToken } from '../lib/users.hl'
  6. import { createProject, addMember } from '../lib/projects.hl'
  7. import { createTicket, addComment, changeComment, editTicket, changeState, assignTicket, setParent, changeBlocker } from '../lib/tickets.hl'
  8. import { createSubscription } from '../lib/subscriptions.hl'
  9. u = ensureUser('p94alice1')
  10. alice = setUserName(u.id, 'alice').user
  11. v = ensureUser('p94bob001')
  12. bob = setUserName(v.id, 'bob').user
  13. mine = createProject(alice, 'miserit-anthar', 'miserit-anthar', 'fixture').project
  14. other = createProject(alice, 'other-proj', 'other-proj', '').project
  15. addMember(mine.id, bob.id, 'edit')
  16. ids = {}
  17. let n = 1
  18. let sub = null
  19. while (n <= 94) {
  20. if (n == 90) { sub = createSubscription(alice, { projects = [mine.id] label = 'p94' }) }
  21. r = createTicket('miserit-anthar', 'fixture ticket ' + n, 'body of fixture ' + n, alice, '', '')
  22. ids['' + n] = r.ticket.id
  23. n = n + 1
  24. }
  25. o1 = createTicket('other-proj', 'other one', 'in the other project', alice, '', '')
  26. t94 = ids['94']
  27. c1 = addComment(t94, alice, 'first comment on the fixture', [{ name = 'pic.txt' type = 'text/plain' bytes = toBytes('fixture-bytes-one') }])
  28. c2 = addComment(t94, bob, 'second comment', [{ name = 'doc.txt' type = 'text/plain' bytes = toBytes('fixture-bytes-two') }])
  29. c3 = addComment(t94, alice, 'third comment, to be deleted', [{ name = 'gone.txt' type = 'text/plain' bytes = toBytes('fixture-bytes-three') }])
  30. ctl = addComment(ids['5'], alice, 'a control comment', [{ name = 'keep.txt' type = 'text/plain' bytes = toBytes('control-bytes') }])
  31. changeComment(t94, c1.event.id, alice, 'edit', 'first comment, edited')
  32. changeComment(t94, c2.event.id, alice, 'like', '')
  33. changeComment(t94, c3.event.id, alice, 'delete', '')
  34. changeComment(ids['5'], ctl.event.id, alice, 'edit', 'control comment, edited')
  35. editTicket(t94, alice, 'fixture ticket 94 edited', 'an edited body')
  36. assignTicket(t94, alice, 'bob')
  37. changeState(t94, 'progress', alice, 'a state note')
  38. setParent(t94, alice, 'miserit-anthar#93')
  39. changeBlocker(t94, alice, 'miserit-anthar#10', true, '')
  40. setParent(ids['30'], alice, 'miserit-anthar#94')
  41. changeBlocker(ids['50'], alice, 'miserit-anthar#94', true, '')
  42. changeBlocker(ids['51'], alice, 'miserit-anthar#52', true, '')
  43. tok = createToken(alice.id, 'p94').token
  44. out = { alice = alice.id mine = mine.id other = other.id t94 = t94 t93 = ids['93'] t50 = ids['50'] t30 = ids['30'] t5 = ids['5'] t51 = ids['51'] token = tok sub = sub.subscription.id }
  45. console.log('SEED ' + JSON.stringify(out))

Branches

Latest commits

  • 5d144817Merge branch 'records-t40' into mainTickets
  • 44ee6f06|||PR records: #43 #45 livemre
  • b8fdeee9Merge branch 'p39-routes' into mainTickets
  • a0187a0a|||PR Remove redundant route-order loopmre
  • 369e4b9cMerge branch 'k40-lists' into mainTickets
  • 9af8e780|||PR Use keyed list mutations for live ticket updatesmre
  • 610d8e8aMerge branch 'records-t39' into mainTickets
  • 32bcdf24|||PR records: GO P39 K40mre
  • 4123c6d1Merge branch 'records-t38' into mainTickets
  • cd3641a1|||PR records: day72 deploy live, tickets closedmre
  • 7d44d852Merge branch 'records-t37' into mainTickets
  • 926f7061|||PR records: merges, D36 deploymre
  • bf58534eMerge branch 'l33-final' into mainTickets
  • 759a9ac3|||PR thin login (tickets#46, #45): merge main, route entry cleanupmre
  • 239436d8Merge remote-tracking branch 'origin/main' into l33-finalmre
  • 5822cb3aMerge branch 'o34-clean' into mainTickets
  • 0870653c|||PR offline note from __hlOnline, no polling (tickets#41)mre
  • 14cf96b4Merge branch 'records-t36' into mainTickets
  • 07749fa1|||PR records: day72 + #40 mergedmre
  • ecd7e226|||PR Consolidate login and move handler logic into topic libraries (partial)mre