Skip to content

Commit bf2b9ba

Browse files
committed
Minor fixes from PR checks
1 parent 8c051bf commit bf2b9ba

File tree

4 files changed

+18
-4
lines changed

4 files changed

+18
-4
lines changed

src/RealtimeServer/scriptureforge/services/sf-project-migrations.spec.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -661,6 +661,20 @@ describe('SFProjectMigrations', () => {
661661
expect(projectDoc.data.editingRequires).toBe(2);
662662
});
663663

664+
it('migrates editable to editingRequires when null', async () => {
665+
const env = new TestEnvironment(24);
666+
const conn = env.server.connect();
667+
await createDoc(conn, SF_PROJECTS_COLLECTION, 'project01', {});
668+
let projectDoc = await fetchDoc(conn, SF_PROJECTS_COLLECTION, 'project01');
669+
expect(projectDoc.data.editable).toBeUndefined();
670+
671+
await env.server.migrateIfNecessary();
672+
673+
projectDoc = await fetchDoc(conn, SF_PROJECTS_COLLECTION, 'project01');
674+
expect(projectDoc.data.editable).toBe(false);
675+
expect(projectDoc.data.editingRequires).toBe(3);
676+
});
677+
664678
it('does not remigrate editingRequires', async () => {
665679
const env = new TestEnvironment(24);
666680
const conn = env.server.connect();

src/SIL.XForge.Scripture/ClientApp/src/app/shared/test-utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ export function getPoetryVerseTextDoc(id: TextDocId, modelHasBlanks: boolean = f
145145
\p
146146
\v 3
147147
*/
148-
export function getEmptyChapterDoc(id: TextDocId, modelHasBlanks: boolean = false): TextData {
148+
export function getEmptyChapterDoc(id: TextDocId, modelHasBlanks: boolean): TextData {
149149
const delta = new Delta();
150150
if (modelHasBlanks) delta.insert({ blank: true }, { segment: 's_1' });
151151
delta.insert('\n', { para: { style: 's' } });

src/SIL.XForge.Scripture/ClientApp/src/app/shared/text/text-view-model.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -784,7 +784,7 @@ export class TextViewModel implements OnDestroy, LynxTextModelConverter {
784784
if ((op.insert as any)?.blank === false) {
785785
const position: number = curIndex + curSegment.length - 1;
786786
const id = `blank_${position}`;
787-
let embedPosition: EmbedPosition | undefined = id == null ? undefined : embeddedElements.get(id);
787+
let embedPosition: EmbedPosition | undefined = embeddedElements.get(id);
788788
if (embedPosition == null && id != null) {
789789
embedPosition = { position };
790790
embeddedElements.set(id, embedPosition);

src/SIL.XForge.Scripture/ClientApp/src/app/translate/editor/editor.component.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2086,8 +2086,8 @@ describe('EditorComponent', () => {
20862086
// Editor position immediately following the end of the anchoring. Note that both the thread1 and thread6 note
20872087
// icon embeds need to be accounted for.
20882088
const immediatelyAfter: number = thread1Position + embedLength * 2 + thread1Doc.data!.position.length;
2089-
// Test insert at index one character outside the text anchor. So not immediately after the anchoring, but another
2090-
// character past that.
2089+
// Test insert at index one character outside the text anchor. So not immediately after the anchoring,
2090+
// but another character past that.
20912091
env.targetEditor.setSelection(immediatelyAfter + 1, 0, 'user');
20922092
env.typeCharacters('a');
20932093
expect(thread1Doc.data!.position).toEqual({ start: 8, length: 9 });

0 commit comments

Comments
 (0)