@@ -6,13 +6,10 @@ import testScenario from 'codecrafters-frontend/mirage/scenarios/test';
6
6
import { signInAsStaff } from 'codecrafters-frontend/tests/support/authentication-helpers' ;
7
7
import createCommunitySolutionsAnalysis from 'codecrafters-frontend/mirage/utils/create-community-solutions-analysis' ;
8
8
9
- // 1. Visiting /courses/shell/admin/code-examples should redirect to ?language_slug=c for the first language in the list
10
- // 2. Language dropdown should work
11
- // 3. Clicking on a stage should redirect to the code example insights page for that stage
12
9
module ( 'Acceptance | course-admin | code-example-insights-index' , function ( hooks ) {
13
10
setupApplicationTest ( hooks ) ;
14
11
15
- test ( 'opening insights index page with no language slug redirects to language slug "c" ' , async function ( assert ) {
12
+ test ( 'code examlpe insights index page tests ' , async function ( assert ) {
16
13
testScenario ( this . server ) ;
17
14
signInAsStaff ( this . owner , this . server ) ;
18
15
@@ -26,6 +23,8 @@ module('Acceptance | course-admin | code-example-insights-index', function (hook
26
23
this . analysis = createCommunitySolutionsAnalysis ( this . server , this . courseStage_1 , this . language_1 ) ;
27
24
this . analysis = createCommunitySolutionsAnalysis ( this . server , this . courseStage_2 , this . language_2 ) ;
28
25
26
+ // Visiting /courses/shell/admin/code-examples should redirect to
27
+ // the page for the first language in the list
29
28
await codeExampleInsightsIndexPage . visit ( { course_slug : this . course . slug } ) ;
30
29
assert . strictEqual ( codeExampleInsightsIndexPage . stageListItems . length , 55 ) ;
31
30
@@ -34,6 +33,7 @@ module('Acceptance | course-admin | code-example-insights-index', function (hook
34
33
35
34
assert . strictEqual ( codeExampleInsightsIndexPage . languageDropdown . currentLanguageName , 'C' ) ;
36
35
36
+ // Language dropdown should work
37
37
await codeExampleInsightsIndexPage . languageDropdown . click ( ) ;
38
38
await codeExampleInsightsIndexPage . languageDropdown . clickOnLanguageLink ( 'Python' ) ;
39
39
assert . strictEqual ( codeExampleInsightsIndexPage . languageDropdown . currentLanguageName , 'Python' ) ;
0 commit comments