Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,10 @@ export class CheckingInputFormComponent {

@Input() set checkingInput(value: Comment | Answer | undefined) {
if (isAnswer(value) && this.textSelectionEnabled) {
this.selectedText = value?.scriptureText;
this.verseRef = value?.verseRef;
this.selectedText = value.scriptureText;
this.verseRef = value.verseRef;
this.selectionStartClipped = value.selectionStartClipped;
this.selectionEndClipped = value.selectionEndClipped;
}
this.textAndAudioInput = value;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@
{ provide: ChapterAudioDialogService, useMock: mockedChapterAudioDialogService },
{ provide: FileService, useMock: mockedFileService },
{ provide: OnlineStatusService, useClass: TestOnlineStatusService },
provideNoopAnimations()

Check warning on line 185 in src/SIL.XForge.Scripture/ClientApp/src/app/checking/checking/checking.component.spec.ts

View workflow job for this annotation

GitHub Actions / Lint and Prettier (22.13.0, 11.11.0, 11.10.0)

`provideNoopAnimations` is deprecated. 20.2 Use `animate.enter` or `animate.leave` instead. Intent to remove in v23
]
}));

Expand Down Expand Up @@ -1805,6 +1805,32 @@
discardPeriodicTasks();
}));

it('keeps the clipped scripture ellipses when editing an answer', fakeAsync(() => {
const env = new TestEnvironment({ user: CHECKER_USER });
const selection: TextSelection = {
verses: { bookNum: 43, chapterNum: 2, verseNum: 2, verse: '2-5' },
text: 'The selected text',
startClipped: true,
endClipped: true
};
when(env.mockedTextChooserDialogComponent.afterClosed()).thenReturn(of(selection));
env.selectQuestion(1);
env.clickButton(env.addAnswerButton);
env.setTextFieldValue(env.yourAnswerField, 'Answer question');
env.clickButton(env.selectVersesButton);
env.clickButton(env.saveAnswerButton);
expect(env.getAnswerScriptureText(0)).toBe('…The selected text…(John 2:2-5)');
// Edit the answer text, leaving the scripture selection alone
env.clickButton(env.getAnswerEditButton(0));
env.waitForSliderUpdate();
env.setTextFieldValue(env.yourAnswerField, 'Edited answer');
env.clickButton(env.saveAnswerButton);
expect(env.getAnswerScriptureText(0)).toBe('…The selected text…(John 2:2-5)');
tick(100);
flush();
discardPeriodicTasks();
}));

it('can remove scripture from an answer', fakeAsync(() => {
const env = new TestEnvironment({ user: CHECKER_USER });
env.selectQuestion(6);
Expand Down
Loading