[document-updater] drop support for tc in briefly (#35864)

GitOrigin-RevId: 00d04d911249b81abc5eb4f9d9dfde4c7f2316b3
This commit is contained in:
Jakob Ackermann
2026-09-17 11:39:22 +00:00
committed by Copybot
parent 7a0a9c3ce5
commit 8fa62d2864
11 changed files with 190 additions and 467 deletions
@@ -587,6 +587,15 @@ describe('Setting a document', function () {
expect(doc.lines).to.deep.equal(this.newLines)
})
it('should provide the tracked changes in editor format when getting the doc', async function () {
const doc = await DocUpdaterClient.getDoc(this.project_id, this.doc_id)
expect(doc.ranges.changes).to.have.length(1)
const [change] = doc.ranges.changes
expect(change.id).to.match(/^[0-9a-f]{24}$/)
expect(change.op).to.deep.equal({ p: 4, d: 'one and a half\n' })
expect(change.metadata).to.deep.equal({ user_id: userId, ts })
})
const cases = [
{
name: 'when resetting the content',
@@ -846,6 +855,17 @@ describe('Setting a document', function () {
)
expect(doc.lines).to.deep.equal(['one', 'two'])
})
it('should provide the tracked deletes in editor format when getting the doc', async function () {
const doc = await DocUpdaterClient.getDoc(
this.project_id,
this.doc_id
)
expect(doc.ranges.changes.map(change => change.op)).to.deep.equal([
{ p: 4, d: 'one and a half\n' },
{ p: 7, d: '\nthree' },
])
})
})
describe('when appending content', function () {
@@ -887,6 +907,17 @@ describe('Setting a document', function () {
)
expect(doc.lines).to.deep.equal(['one', 'two', 'three', 'four'])
})
it('should provide the tracked insert in editor format when getting the doc', async function () {
const doc = await DocUpdaterClient.getDoc(
this.project_id,
this.doc_id
)
expect(doc.ranges.changes.map(change => change.op)).to.deep.equal([
{ p: 4, d: 'one and a half\n' },
{ p: 13, i: '\nfour' },
])
})
})
})
})