|
|
@@ -8,6 +8,7 @@ import { Observable, of, Subject, throwError } from 'rxjs';
|
|
|
import { CourseCenterPageComponent } from '../features/course-center/course-center-page.component';
|
|
|
import { AppointmentPageComponent } from '../features/appointment/appointment-page.component';
|
|
|
import { LearningPageComponent } from '../features/learning/learning-page.component';
|
|
|
+import { StudyRecordsPageComponent } from '../features/study-records/study-records-page.component';
|
|
|
import { HomePageComponent } from '../features/home/home-page.component';
|
|
|
import { routes } from '../app.routes';
|
|
|
import { ApiService } from './api.service';
|
|
|
@@ -751,6 +752,9 @@ describe('home learning modules', () => {
|
|
|
const currentLearningCard = harness.routeNativeElement?.querySelector('.current-learning-card') as HTMLElement;
|
|
|
const learningRecordCard = harness.routeNativeElement?.querySelector('.learning-record-card') as HTMLElement;
|
|
|
expect(currentLearningCard.textContent).toContain('我的学习内容');
|
|
|
+ const records = harness.fixture.debugElement.query(By.directive(StudyRecordsPageComponent)).componentInstance as StudyRecordsPageComponent;
|
|
|
+ expect(records.courseTitle({ Title: '单词课|高中@人教版2022年录', Title2: '人教版2022年录' })).toBe('【高中】人教版2022年录');
|
|
|
+ expect(records.courseTitle({ Title: '单词课|初中@人教版2024年9月录', Title2: '人教版2024年9月录' })).toBe('【初中】人教版2024年9月录');
|
|
|
expect(currentLearningCard.querySelectorAll('.current-learning-list button').length).toBe(2);
|
|
|
expect((currentLearningCard.querySelectorAll('.current-learning-list button')[1] as HTMLButtonElement).disabled).toBeFalse();
|
|
|
expect(currentLearningCard.compareDocumentPosition(learningRecordCard) & Node.DOCUMENT_POSITION_FOLLOWING).toBeTruthy();
|