Skip to content

Commit 20a50c5

Browse files
committed
refactor: update test description and comments in code example insights index page tests
1 parent 09b4b66 commit 20a50c5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tests/acceptance/course-admin/code-example-insights-index-test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,10 @@ import testScenario from 'codecrafters-frontend/mirage/scenarios/test';
66
import { signInAsStaff } from 'codecrafters-frontend/tests/support/authentication-helpers';
77
import createCommunitySolutionsAnalysis from 'codecrafters-frontend/mirage/utils/create-community-solutions-analysis';
88

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
129
module('Acceptance | course-admin | code-example-insights-index', function (hooks) {
1310
setupApplicationTest(hooks);
1411

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) {
1613
testScenario(this.server);
1714
signInAsStaff(this.owner, this.server);
1815

@@ -26,6 +23,8 @@ module('Acceptance | course-admin | code-example-insights-index', function (hook
2623
this.analysis = createCommunitySolutionsAnalysis(this.server, this.courseStage_1, this.language_1);
2724
this.analysis = createCommunitySolutionsAnalysis(this.server, this.courseStage_2, this.language_2);
2825

26+
// Visiting /courses/shell/admin/code-examples should redirect to
27+
// the page for the first language in the list
2928
await codeExampleInsightsIndexPage.visit({ course_slug: this.course.slug });
3029
assert.strictEqual(codeExampleInsightsIndexPage.stageListItems.length, 55);
3130

@@ -34,6 +33,7 @@ module('Acceptance | course-admin | code-example-insights-index', function (hook
3433

3534
assert.strictEqual(codeExampleInsightsIndexPage.languageDropdown.currentLanguageName, 'C');
3635

36+
// Language dropdown should work
3737
await codeExampleInsightsIndexPage.languageDropdown.click();
3838
await codeExampleInsightsIndexPage.languageDropdown.clickOnLanguageLink('Python');
3939
assert.strictEqual(codeExampleInsightsIndexPage.languageDropdown.currentLanguageName, 'Python');

0 commit comments

Comments
 (0)