|
|
@@ -845,7 +845,7 @@ describe('home learning modules', () => {
|
|
|
expect(learning().words().length).toBe(2);
|
|
|
expect(learning().currentIndex()).toBe(0);
|
|
|
const skip = Array.from(harness.routeNativeElement?.querySelectorAll<HTMLButtonElement>('.skippable-spelling-actions button') ?? [])
|
|
|
- .find((button) => button.textContent?.includes('跳到下一关'))!;
|
|
|
+ .find((button) => button.textContent?.includes('跳过这一关'))!;
|
|
|
skip.click();
|
|
|
await harness.fixture.whenStable();
|
|
|
harness.fixture.detectChanges();
|
|
|
@@ -1498,7 +1498,7 @@ describe('home learning modules', () => {
|
|
|
harness.fixture.detectChanges();
|
|
|
const spellingActions = harness.routeNativeElement?.querySelector('.teacher-spelling-actions') as HTMLElement;
|
|
|
expect(spellingActions.querySelectorAll('button').length).toBe(3);
|
|
|
- expect(spellingActions.textContent).toContain('跳到下一关');
|
|
|
+ expect(spellingActions.textContent).toContain('跳过这一关');
|
|
|
expect((harness.fixture.debugElement.query(By.directive(LearningPageComponent)).componentInstance as LearningPageComponent).words().length).toBe(1);
|
|
|
expect(localStorage.getItem('xiaoshu.learning.300.100.701._page_word_orilist')).not.toBeNull();
|
|
|
(spellingActions.querySelectorAll('button')[1] as HTMLButtonElement).click();
|
|
|
@@ -1735,23 +1735,29 @@ describe('home learning modules', () => {
|
|
|
await harness.fixture.whenStable();
|
|
|
harness.fixture.detectChanges();
|
|
|
const learning = () => harness.fixture.debugElement.query(By.directive(LearningPageComponent)).componentInstance as LearningPageComponent;
|
|
|
- learning().skipStudyList();
|
|
|
+ const skipStage = () => {
|
|
|
+ const button = Array.from(harness.routeNativeElement?.querySelectorAll<HTMLButtonElement>('.sticky-actions button') ?? [])
|
|
|
+ .find(item => item.textContent?.includes('跳过这一关'));
|
|
|
+ expect(button).toBeDefined();
|
|
|
+ button!.click();
|
|
|
+ };
|
|
|
+ skipStage();
|
|
|
await harness.fixture.whenStable();
|
|
|
harness.fixture.detectChanges();
|
|
|
expect(router.url).toContain('/pages/stu/stu3');
|
|
|
- const pair = learning().words()[0];
|
|
|
- learning().chooseMatch('left', pair);
|
|
|
- learning().chooseMatch('right', pair);
|
|
|
- learning().continueAfterStage();
|
|
|
+ expect(learning().matchLeft().length).toBe(1);
|
|
|
+ skipStage();
|
|
|
await harness.fixture.whenStable();
|
|
|
harness.fixture.detectChanges();
|
|
|
expect(router.url).toContain('/pages/stu/stu4');
|
|
|
- learning().chooseMeaning(learning().words()[0]);
|
|
|
- learning().continueAfterStage();
|
|
|
+ expect(learning().correct()).toBe(0);
|
|
|
+ skipStage();
|
|
|
await harness.fixture.whenStable();
|
|
|
harness.fixture.detectChanges();
|
|
|
expect(router.url).toContain('/pages/stu/pl_stu5');
|
|
|
- learning().skipSpellingStage();
|
|
|
+ expect(router.url).toContain('orderId=901');
|
|
|
+ expect(learning().correct()).toBe(0);
|
|
|
+ skipStage();
|
|
|
expect(learning().hasNextWordBatch).toBeFalse();
|
|
|
await harness.fixture.whenStable();
|
|
|
harness.fixture.detectChanges();
|