mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-15 06:33:55 +01:00
[ranges-tracker] add legacy orderedRejections field in tracked-changes (#36565)
* [docstore] use more realistic test stubs for ranges * [monorepo] define ranges schemas in @overleaf/ranges-tracker * [ranges-tracker] add legacy orderedRejections field in tracked-changes * [monorepo] resolve @overleaf/ranges-tracker subpath imports in typescript * [real-time] validate comment thread ids and tracked change id seeds * [ranges-tracker] require ObjectId ids and tracked change metadata in ranges * [monorepo] require ObjectId tracked change ids on the accept routes * [web] use ObjectId comment thread ids in the DocumentController tests GitOrigin-RevId: 58b20dec311d85b917ef63f9efbe745a265a2de6
This commit is contained in:
@@ -307,9 +307,9 @@ describe('Ranges', function () {
|
||||
historyRangesSupport: true,
|
||||
})
|
||||
await DocUpdaterClient.preloadDoc(this.project_id, this.doc.id)
|
||||
this.id_seed_1 = 'tc_1'
|
||||
this.id_seed_2 = 'tc_2'
|
||||
this.id_seed_3 = 'tc_3'
|
||||
this.id_seed_1 = '587357bd35e64f6151'
|
||||
this.id_seed_2 = '587357bd35e64f6152'
|
||||
this.id_seed_3 = '587357bd35e64f6153'
|
||||
|
||||
this.updates = [
|
||||
{
|
||||
@@ -718,7 +718,7 @@ describe('Ranges', function () {
|
||||
before(async function () {
|
||||
this.project_id = DocUpdaterClient.randomId()
|
||||
this.user_id = DocUpdaterClient.randomId()
|
||||
this.id_seed = DocUpdaterClient.randomId()
|
||||
this.id_seed = '587357bd35e64f6157'
|
||||
this.doc = {
|
||||
id: DocUpdaterClient.randomId(),
|
||||
lines: ['aaa'],
|
||||
|
||||
@@ -11,7 +11,7 @@ const {
|
||||
zz,
|
||||
} = require('@overleaf/validation-tools')
|
||||
const { rawStringFileData } = require('overleaf-editor-core/lib/schemas')
|
||||
const schemas = require('../../../../app/js/schemas')
|
||||
const schemas = require('@overleaf/ranges-tracker/schemas')
|
||||
const app = express()
|
||||
const MAX_REQUEST_SIZE = 2 * (2 * 1024 * 1024 + 64 * 1024)
|
||||
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
const { expect } = require('chai')
|
||||
const { insertOp, deleteOp } = require('../../../app/js/schemas')
|
||||
|
||||
describe('schemas', function () {
|
||||
describe('insertOp', function () {
|
||||
it('accepts a legacy fixedRemoveChange flag', function () {
|
||||
const result = insertOp.safeParse({
|
||||
i: 'foo',
|
||||
p: 0,
|
||||
fixedRemoveChange: true,
|
||||
})
|
||||
expect(result.success).to.equal(true)
|
||||
})
|
||||
|
||||
it('rejects an unrecognized key', function () {
|
||||
const result = insertOp.safeParse({ i: 'foo', p: 0, somethingElse: true })
|
||||
expect(result.success).to.equal(false)
|
||||
})
|
||||
})
|
||||
|
||||
describe('deleteOp', function () {
|
||||
it('accepts a legacy fixedRemoveChange flag', function () {
|
||||
const result = deleteOp.safeParse({
|
||||
d: 'foo',
|
||||
p: 0,
|
||||
fixedRemoveChange: true,
|
||||
})
|
||||
expect(result.success).to.equal(true)
|
||||
})
|
||||
|
||||
it('rejects an unrecognized key', function () {
|
||||
const result = deleteOp.safeParse({ d: 'foo', p: 0, somethingElse: true })
|
||||
expect(result.success).to.equal(false)
|
||||
})
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user