Skip to content

Commit

Permalink
Fix client tests: video-unit-form.component.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
florian-glombik committed Nov 20, 2024
1 parent 834fbd1 commit 659a8b5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export class VideoUnitFormComponent {
competencyLinks: [undefined as CompetencyLectureUnitLink[] | undefined],
});
private readonly statusChanges = toSignal(this.form.statusChanges ?? 'INVALID');
isFormValid = computed(() => this.statusChanges() === 'VALID') && this.datePickerComponent()?.isValid();
isFormValid = computed(() => this.statusChanges() === 'VALID' && this.datePickerComponent()?.isValid());

constructor() {
effect(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@ import { VideoUnitFormComponent, VideoUnitFormData } from 'app/lecture/lecture-u
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { ArtemisTranslatePipe } from 'app/shared/pipes/artemis-translate.pipe';
import { MockComponent, MockPipe } from 'ng-mocks';
import { MockComponent, MockModule, MockPipe } from 'ng-mocks';
import { FormDateTimePickerComponent } from 'app/shared/date-time-picker/date-time-picker.component';
import { FaIconComponent } from '@fortawesome/angular-fontawesome';
import { CompetencySelectionComponent } from 'app/shared/competency-selection/competency-selection.component';
import { OwlDateTimeModule, OwlNativeDateTimeModule } from '@danielmoncada/angular-datetime-picker';
import { ArtemisTestModule } from '../../../test.module';
import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap';

describe('VideoUnitFormComponent', () => {
const validYouTubeUrl = 'https://www.youtube.com/watch?v=8iU8LPEa4o0';
Expand All @@ -16,13 +19,14 @@ describe('VideoUnitFormComponent', () => {

beforeEach(() => {
TestBed.configureTestingModule({
imports: [ReactiveFormsModule, FormsModule],
imports: [ArtemisTestModule, ReactiveFormsModule, FormsModule, FormDateTimePickerComponent, MockModule(NgbTooltipModule)],
declarations: [
VideoUnitFormComponent,
MockPipe(ArtemisTranslatePipe),
MockComponent(FormDateTimePickerComponent),
MockComponent(FaIconComponent),
MockComponent(CompetencySelectionComponent),
MockModule(OwlDateTimeModule),
MockModule(OwlNativeDateTimeModule),
],
providers: [],
schemas: [],
Expand Down

0 comments on commit 659a8b5

Please sign in to comment.