Skip to content

Commit 18ec72f

Browse files
committed
fix tests
1 parent 05bd093 commit 18ec72f

File tree

15 files changed

+72
-60
lines changed

15 files changed

+72
-60
lines changed

src/SIL.XForge.Scripture/ClientApp/src/app/checking/chapter-audio-dialog/chapter-audio-dialog.component.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ describe('ChapterAudioDialogComponent', () => {
368368
// The "from" value of the next entry
369369
expect(result.timingData[0].to).toEqual(1.1);
370370
// The end of the audio file
371-
expect(result.timingData[1].to).toEqual(1.32);
371+
expect(result.timingData[1].to).toEqual(1.296);
372372
}));
373373

374374
it('will not save or upload if there is no audio', fakeAsync(() => {

src/SIL.XForge.Scripture/ClientApp/src/app/checking/question-dialog/question-dialog.service.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const mockedFileService = mock(FileService);
3939

4040
describe('QuestionDialogService', () => {
4141
configureTestingModule(() => ({
42-
imports: [getTestTranslocoModule()],
42+
imports: [getTestTranslocoModule(false)],
4343
providers: [
4444
provideTestRealtime(SF_TYPE_REGISTRY),
4545
{ provide: FileService, useMock: mockedFileService },

src/SIL.XForge.Scripture/ClientApp/src/app/serval-administration/serval-projects.component.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { Component, DestroyRef, OnInit } from '@angular/core';
2+
import { MatButton } from '@angular/material/button';
23
import { MatFormField, MatLabel } from '@angular/material/form-field';
34
import { MatIcon } from '@angular/material/icon';
45
import { MatInput } from '@angular/material/input';
@@ -25,8 +26,8 @@ import { DataLoadingComponent } from 'xforge-common/data-loading-component';
2526
import { I18nService } from 'xforge-common/i18n.service';
2627
import { NoticeService } from 'xforge-common/notice.service';
2728
import { QueryParameters } from 'xforge-common/query-parameters';
29+
import { RouterLinkDirective } from 'xforge-common/router-link.directive';
2830
import { quietTakeUntilDestroyed } from 'xforge-common/util/rxjs-util';
29-
import { RouterLinkDirective } from '../../xforge-common/router-link.directive';
3031
import { SFProjectProfileDoc } from '../core/models/sf-project-profile-doc';
3132
import { projectLabel } from '../shared/utils';
3233
import { DraftSourcesAsTranslateSourceArrays, projectToDraftSources } from '../translate/draft-generation/draft-utils';
@@ -82,6 +83,7 @@ class Row {
8283
templateUrl: './serval-projects.component.html',
8384
styleUrls: ['./serval-projects.component.scss'],
8485
imports: [
86+
MatButton,
8587
MatTable,
8688
MatColumnDef,
8789
MatHeaderCell,
@@ -159,7 +161,7 @@ export class ServalProjectsComponent extends DataLoadingComponent implements OnI
159161
}
160162

161163
viewDraftJobs(projectId: string): void {
162-
this.router.navigate(['/serval-administration'], {
164+
void this.router.navigate(['/serval-administration'], {
163165
queryParams: {
164166
projectId,
165167
tab: 'draft-jobs'

src/SIL.XForge.Scripture/ClientApp/src/app/shared/sf-tab-group/tab-group-header/tab-group-header.component.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,19 +39,19 @@ import { TabScrollButtonComponent } from './tab-scroll-button/tab-scroll-button.
3939
templateUrl: './tab-group-header.component.html',
4040
styleUrls: ['./tab-group-header.component.scss'],
4141
imports: [
42-
TabScrollButtonComponent,
4342
CdkDropList,
44-
NgFor,
45-
TabHeaderComponent,
4643
CdkDrag,
44+
NgFor,
45+
NgIf,
4746
NgTemplateOutlet,
48-
MatMenuTrigger,
47+
AsyncPipe,
4948
MatIcon,
5049
MatMenu,
51-
NgIf,
5250
MatMenuItem,
53-
AsyncPipe,
54-
TranslocoModule
51+
MatMenuTrigger,
52+
TranslocoModule,
53+
TabHeaderComponent,
54+
TabScrollButtonComponent
5555
]
5656
})
5757
export class TabGroupHeaderComponent implements OnChanges, OnInit, AfterViewInit, OnDestroy {

src/SIL.XForge.Scripture/ClientApp/src/app/shared/text/text-note-dialog/text-note-dialog.component.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { NoteDialogData, TextNoteDialogComponent, TextNoteType } from './text-no
1313

1414
describe('TextNoteDialogComponent', () => {
1515
configureTestingModule(() => ({
16-
imports: [getTestTranslocoModule(), TextNoteDialogComponent],
16+
imports: [getTestTranslocoModule(false), TextNoteDialogComponent],
1717
providers: [provideNoopAnimations()]
1818
}));
1919
let env: TestEnvironment;

src/SIL.XForge.Scripture/ClientApp/src/app/translate/biblical-terms/biblical-terms.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { SlicePipe } from '@angular/common';
1+
import { NgFor, SlicePipe } from '@angular/common';
22
import { Component, DestroyRef, ElementRef, Input, OnDestroy, OnInit, ViewChild } from '@angular/core';
33
import { FormsModule } from '@angular/forms';
44
import { MatIconButton } from '@angular/material/button';
@@ -195,6 +195,7 @@ class Row {
195195
templateUrl: './biblical-terms.component.html',
196196
styleUrls: ['./biblical-terms.component.scss'],
197197
imports: [
198+
NgFor,
198199
FormsModule,
199200
TranslocoModule,
200201
MatTooltip,

src/SIL.XForge.Scripture/ClientApp/src/app/translate/draft-generation/draft-generation.component.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ describe('DraftGenerationComponent', () => {
7878
}
7979

8080
TestBed.configureTestingModule({
81-
imports: [, getTestTranslocoModule()],
81+
imports: [getTestTranslocoModule()],
8282
providers: [
8383
provideRouter([]),
8484
provideTestOnlineStatus(),

src/SIL.XForge.Scripture/ClientApp/src/app/translate/draft-generation/draft-generation.component.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { AsyncPipe } from '@angular/common';
22
import { HttpErrorResponse } from '@angular/common/http';
33
import { Component, DestroyRef, OnInit, ViewChild } from '@angular/core';
4-
import { MatButton } from '@angular/material/button';
4+
import { MatAnchor, MatButton } from '@angular/material/button';
55
import {
66
MatCard,
77
MatCardActions,
@@ -68,6 +68,7 @@ import { SupportedBackTranslationLanguagesDialogComponent } from './supported-ba
6868
styleUrls: ['./draft-generation.component.scss'],
6969
imports: [
7070
AsyncPipe,
71+
MatAnchor,
7172
MatButton,
7273
MatIcon,
7374
MatCard,
@@ -231,7 +232,7 @@ export class DraftGenerationComponent extends DataLoadingComponent implements On
231232
const dialogRef = this.dialogService.openMatDialog(SupportedBackTranslationLanguagesDialogComponent);
232233

233234
dialogRef.afterClosed().subscribe(() => {
234-
this.router.navigate([], { fragment: undefined });
235+
void this.router.navigate([], { fragment: undefined });
235236
});
236237
});
237238

@@ -433,7 +434,7 @@ export class DraftGenerationComponent extends DataLoadingComponent implements On
433434
if (this.isDraftInProgress(job)) {
434435
this.draftJob = job;
435436
this.currentPage = 'initial';
436-
this.dialogService.message('draft_generation.draft_already_running');
437+
void this.dialogService.message('draft_generation.draft_already_running');
437438
return;
438439
}
439440
});

src/SIL.XForge.Scripture/ClientApp/src/app/translate/draft-generation/draft-sources/draft-sources.component.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { KeyValuePipe, NgTemplateOutlet } from '@angular/common';
12
import { Component, DestroyRef, EventEmitter } from '@angular/core';
23
import { MatButton } from '@angular/material/button';
34
import { MatCard, MatCardActions, MatCardContent, MatCardHeader, MatCardTitle } from '@angular/material/card';
@@ -41,6 +42,7 @@ import {
4142
import { LanguageCodesConfirmationComponent } from '../language-codes-confirmation/language-codes-confirmation.component';
4243
import { TrainingDataMultiSelectComponent } from '../training-data/training-data-multi-select.component';
4344
import { TrainingDataService } from '../training-data/training-data.service';
45+
4446
/** Status for a project, which may or may not be at SF. */
4547
export interface ProjectStatus {
4648
shortName: string;
@@ -53,6 +55,8 @@ export interface ProjectStatus {
5355
@Component({
5456
selector: 'app-draft-sources',
5557
imports: [
58+
NgTemplateOutlet,
59+
KeyValuePipe,
5660
MatButton,
5761
MatIcon,
5862
MatRipple,

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ import { BuildStates } from '../../machine-api/build-states';
9999
import { HttpClient } from '../../machine-api/http-client';
100100
import { RemoteTranslationEngine } from '../../machine-api/remote-translation-engine';
101101
import { CopyrightBannerComponent } from '../../shared/copyright-banner/copyright-banner.component';
102+
import { provideCustomIcons } from '../../shared/custom-icons';
102103
import {
103104
provideSFTabs,
104105
TabComponent,
@@ -180,14 +181,14 @@ describe('EditorComponent', () => {
180181
BiblicalTermsComponent,
181182
CopyrightBannerComponent,
182183
DraftPreviewBooksComponent,
183-
getTestTranslocoModule(),
184-
TranslocoMarkupModule,
185184
TabGroupComponent,
186185
TabComponent,
187186
TabHeaderDirective,
188187
LynxInsightEditorObjectsComponent,
189188
LynxInsightsPanelComponent,
190-
AngularSplitModule
189+
AngularSplitModule,
190+
getTestTranslocoModule(),
191+
TranslocoMarkupModule
191192
],
192193
providers: [
193194
provideRouter(ROUTES),
@@ -196,6 +197,7 @@ describe('EditorComponent', () => {
196197
provideTestRealtime(SF_TYPE_REGISTRY),
197198
provideSFTabs(),
198199
provideLynxInsights(),
200+
provideCustomIcons(),
199201
{ provide: AuthService, useMock: mockedAuthService },
200202
{ provide: SFProjectService, useMock: mockedSFProjectService },
201203
{ provide: UserService, useMock: mockedUserService },

0 commit comments

Comments
 (0)