tickets
All repositories: gitoria
1.8 KB
// tests/events-seed.hl — the fixture of tests/events.mjs (ticket #26): an EMPTY store (TICKETS_STORAGE, absolute) gets// three users with display names (alice, bob, carol), two projects (alpha: alice admin, bob use; beta: bob admin),// one ticket in each, an API token per user and a project key (tktc_, connected to beta). Prints one JSON line.import { ensureUser, setUserName, createToken } from '../lib/users.hl'import { createProject, addMember } from '../lib/projects.hl'import { createTicket } from '../lib/tickets.hl'import { createRequest, confirmRequest, exchangeConnectCode } from '../lib/connections.hl'person = (identity, name) => {u = ensureUser(identity)r = setUserName(u.id, name)return r.user}alice = person('evalice01', 'alice')bob = person('evbob0001', 'bob')carol = person('evcarol01', 'carol')alpha = createProject(alice, 'alpha', 'alpha', '').projectbeta = createProject(bob, 'beta', 'beta', '').projectaddMember(alpha.id, bob.id, 'use')a1 = createTicket('alpha', 'alpha one', 'the first alpha ticket', alice, '', '')b1 = createTicket('beta', 'beta one', 'the first beta ticket', bob, '', '')req = createRequest('eventsgate', 'gate/beta', 'https://gate.worldapi.org/back', 's')conf = confirmRequest(req.nonce, bob, beta.id, '')code = conf.url.split('code=')[1].split('&')[0]key = exchangeConnectCode(code).key// the tokens BEFORE the literal: an entry named `alice` would shadow the variable for the entries after itta = createToken(alice.id, 'events').tokentb = createToken(bob.id, 'events').tokentc = createToken(carol.id, 'events').tokenout = { alice = alice.id bob = bob.id carol = carol.id alpha = alpha.id beta = beta.id alphaTicket = a1.ticket.id betaTicket = b1.ticket.idaliceToken = ta bobToken = tb carolToken = tc betaKey = key }console.log('SEED ' + JSON.stringify(out))
Branches
Latest commits
- fd6ca1e6Tickets conductor: brief 027 waker design, push-test projectmre
- e448e656Tickets conductor: STATUS #51mre
- 1c10857bTickets conductor: P51 eval, brief 027mre
- e725969dTickets conductor: #51 directionmre
- 1b5c63ddTickets conductor: P51 startedmre
- 9f13fbdaTickets conductor: brief 026 prioritymre
- acc477d9Tickets conductor: brief 026 + Vinzenz recommendationsmre
- 9233a734Tickets conductor: brief 026 completemre
- 5da589fdTickets conductor: brief 026 + Gitoria's answermre
- a3cd5329Tickets conductor: tickets#51 opened, brief 026 draftmre
- 6f6e5797Tickets conductor: STATUS wordingmre
- 957de51fTickets conductor: T36 live, #36 review, #50 donemre
- bc2fde32Merge branch 'main' into t36-stylemre
- b7ca093atests: wait for the new row and normalize editor marker spacesmre
- 41da3525Tickets conductor: flake cause, T36 deploy stepmre
- 64c477e6Tickets conductor: deploy waits for Arachnemre
- 467d7286Tickets conductor: T36 done, deploy questionmre
- fed5ca81ticket_list: remove repeated selected-state coloursmre
- 8542fc8aTickets conductor: T36 proof reviewedmre
- 35980936inbox: preserve desktop columns after list styles were scopedmre