-
Notifications
You must be signed in to change notification settings - Fork 19
feat(header): enhance track page header layout and content #2597
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<LinkTo | ||
@route="catalog" | ||
class="block hover:bg-gray-50 dark:hover:bg-gray-700/50 py-1.5 -mx-1.5 px-1.5 rounded" | ||
data-test-stage-list-item | ||
...attributes | ||
> | ||
<div class="flex items-center justify-between"> | ||
<div class="flex items-center"> | ||
<div class="w-2 h-2 {{if @isComplete 'bg-teal-500' 'bg-gray-200 dark:bg-gray-700'}} rounded-full mr-2"></div> | ||
|
||
{{! TODO: Qualify all heroicons with solid/outline }} | ||
{{svg-jar "academic-cap-outline" class="w-6 mr-1.5 text-gray-400 dark:text-gray-600"}} | ||
|
||
<div class="prose dark:prose-invert prose-sm"> | ||
{{@name}} | ||
</div> | ||
</div> | ||
|
||
{{#if @isComplete}} | ||
{{svg-jar "check" class="ml-1 w-5 text-teal-500"}} | ||
{{else}} | ||
<div class="flex items-center gap-x-2"> | ||
{{!-- <div class="flex items-center"> | ||
{{svg-jar "clipboard-check" class="w-4 mr-1 fill-current text-gray-300 dark:text-gray-700"}} | ||
|
||
<span class="text-xs text-gray-400 dark:text-gray-600"> | ||
4 questions | ||
</span> | ||
</div> | ||
|
||
<div class="h-3 w-px bg-gray-200"></div> --}} | ||
|
||
<div class="flex items-center"> | ||
{{svg-jar "clock" class="w-4 mr-1 fill-current text-gray-300 dark:text-gray-700"}} | ||
|
||
<span class="text-xs text-gray-400 dark:text-gray-600"> | ||
{{@estimatedReadingTimeInMinutes}} mins | ||
</span> | ||
</div> | ||
</div> | ||
{{/if}} | ||
</div> | ||
</LinkTo> |
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,19 @@ | ||||||||||||||||||||||||||||||||||||||
import Component from '@glimmer/component'; | ||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
interface Signature { | ||||||||||||||||||||||||||||||||||||||
Element: HTMLButtonElement; | ||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
Args: { | ||||||||||||||||||||||||||||||||||||||
name: string; | ||||||||||||||||||||||||||||||||||||||
isComplete: boolean; | ||||||||||||||||||||||||||||||||||||||
estimatedReadingTimeInMinutes: number; | ||||||||||||||||||||||||||||||||||||||
}; | ||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||
Comment on lines
+3
to
+11
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix element type in component signature. The interface specifies Apply this diff to fix the element type: interface Signature {
- Element: HTMLButtonElement;
+ Element: HTMLAnchorElement;
Args: {
name: string;
isComplete: boolean;
estimatedReadingTimeInMinutes: number;
};
} 📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
export default class TrackConceptItemComponent extends Component<Signature> {} | ||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
declare module '@glint/environment-ember-loose/registry' { | ||||||||||||||||||||||||||||||||||||||
export default interface Registry { | ||||||||||||||||||||||||||||||||||||||
TrackConceptItem: typeof TrackConceptItemComponent; | ||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||
} |
Original file line number | Diff line number | Diff line change | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -1,32 +1,54 @@ | ||||||||||||||
<div class="flex items-center justify-between" ...attributes data-test-track-header> | ||||||||||||||
<div> | ||||||||||||||
<h1 class="text-3xl md:text-5xl text-gray-800 dark:text-gray-50 font-bold tracking-tighter mb-3">{{@language.trackTitle}}</h1> | ||||||||||||||
<div ...attributes data-test-track-header> | ||||||||||||||
<div class="flex items-center justify-between"> | ||||||||||||||
<div> | ||||||||||||||
<h1 class="text-3xl md:text-5xl text-gray-800 dark:text-gray-50 font-bold tracking-tighter mb-2">{{@language.trackTitle}}</h1> | ||||||||||||||
|
||||||||||||||
<p class="text-gray-600 dark:text-gray-400 mb-4 max-w-xl" data-test-track-header-description> | ||||||||||||||
{{markdown-to-html @language.trackDescriptionMarkdown}} | ||||||||||||||
</p> | ||||||||||||||
<p class="text-gray-600 dark:text-gray-400 mb-4 max-w-xl" data-test-track-header-description> | ||||||||||||||
{{markdown-to-html @language.trackDescriptionMarkdown}} | ||||||||||||||
</p> | ||||||||||||||
|
||||||||||||||
<div class="flex items-center flex-wrap-reverse gap-x-2 gap-y-4"> | ||||||||||||||
{{#if this.currentUserHasStartedTrack}} | ||||||||||||||
<TrackPage::ResumeTrackButton @language={{@language}} @courses={{@courses}} /> | ||||||||||||||
{{else}} | ||||||||||||||
<TrackPage::StartTrackButton @language={{@language}} @courses={{@courses}} /> | ||||||||||||||
{{/if}} | ||||||||||||||
|
||||||||||||||
{{#if (gt this.topParticipants.length 0)}} | ||||||||||||||
<div class="flex items-center gap-x-3"> | ||||||||||||||
<div class="flex items-center"> | ||||||||||||||
<div class="flex -space-x-1 hover:space-x-1 items-center"> | ||||||||||||||
{{#each this.topParticipants as |user|}} | ||||||||||||||
<TrackPage::Header::TopParticipantAvatar @user={{user}} /> | ||||||||||||||
{{/each}} | ||||||||||||||
</div> | ||||||||||||||
|
||||||||||||||
<span class="text-xs text-gray-600 dark:text-gray-400 ml-2">Join the best</span> | ||||||||||||||
{{svg-jar "user-group" class="w-4 mr-1 fill-current text-gray-400 dark:text-gray-600"}} | ||||||||||||||
<span class="text-xs text-gray-500">203,192 learners</span> | ||||||||||||||
</div> | ||||||||||||||
<div class="h-3 w-px bg-gray-200"></div> | ||||||||||||||
<div class="flex items-center"> | ||||||||||||||
{{svg-jar "terminal" class="w-4 mr-1 fill-current text-gray-400 dark:text-gray-600"}} | ||||||||||||||
<span class="text-xs text-gray-500">248 exercises</span> | ||||||||||||||
</div> | ||||||||||||||
{{/if}} | ||||||||||||||
<div class="h-3 w-px bg-gray-200"></div> | ||||||||||||||
<div class="flex items-center"> | ||||||||||||||
{{svg-jar "academic-cap" class="w-4 mr-1 fill-current text-gray-400 dark:text-gray-600"}} | ||||||||||||||
<span class="text-xs text-gray-500">56 concepts</span> | ||||||||||||||
</div> | ||||||||||||||
<div class="h-3 w-px bg-gray-200"></div> | ||||||||||||||
<div class="flex items-center"> | ||||||||||||||
{{svg-jar "clipboard-check" class="w-4 mr-1 fill-current text-gray-400 dark:text-gray-600"}} | ||||||||||||||
<span class="text-xs text-gray-500">148 questions</span> | ||||||||||||||
</div> | ||||||||||||||
{{!-- <div class="h-1 w-1 bg-gray-400 rounded-full"></div> | ||||||||||||||
<div class="flex items-center flex-wrap-reverse gap-x-2 gap-y-4"> | ||||||||||||||
{{#if (gt this.topParticipants.length 0)}} | ||||||||||||||
<div class="flex items-center"> | ||||||||||||||
<div class="flex -space-x-1 hover:space-x-1 items-center"> | ||||||||||||||
{{#each this.topParticipants as |user|}} | ||||||||||||||
<TrackPage::Header::TopParticipantAvatar @user={{user}} /> | ||||||||||||||
{{/each}} | ||||||||||||||
</div> | ||||||||||||||
|
||||||||||||||
<span class="text-xs text-gray-600 dark:text-gray-400 ml-2">Join the best</span> | ||||||||||||||
</div> | ||||||||||||||
{{/if}} | ||||||||||||||
</div> --}} | ||||||||||||||
</div> | ||||||||||||||
</div> | ||||||||||||||
Comment on lines
+10
to
+44
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Replace hardcoded statistics with dynamic values. The statistics section looks great, but the numbers appear to be hardcoded:
These should be dynamic values from the backend to ensure accuracy. Would you like me to help create a new component or modify this template to accept these statistics as parameters? |
||||||||||||||
|
||||||||||||||
<div class="ml-4 hidden md:block bg-white rounded-full p-2 border-2 border-gray-200 shadow"> | ||||||||||||||
<img src="https://raw.githubusercontent.com/rust-lang/rust-artwork/refs/heads/master/logo/rust-logo-blk.svg" class="h-36" /> | ||||||||||||||
{{!-- <LanguageLogo @language={{@language}} @variant="teal" class="h-36 dark:opacity-90" /> --}} | ||||||||||||||
</div> | ||||||||||||||
Comment on lines
+47
to
+49
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Restore dynamic logo handling. The hardcoded Rust logo URL makes this component track-specific, whereas the commented-out
- <div class="ml-4 hidden md:block bg-white rounded-full p-2 border-2 border-gray-200 shadow">
- <img src="https://raw.githubusercontent.com/rust-lang/rust-artwork/refs/heads/master/logo/rust-logo-blk.svg" class="h-36" />
- {{!-- <LanguageLogo @language={{@language}} @variant="teal" class="h-36 dark:opacity-90" /> --}}
+ <div class="ml-4 hidden md:block bg-white rounded-full p-2 border-2 border-gray-200 shadow">
+ <LanguageLogo @language={{@language}} @variant="teal" class="h-36 dark:opacity-90" />
</div> 📝 Committable suggestion
Suggested change
|
||||||||||||||
</div> | ||||||||||||||
<div class="ml-4 hidden md:block"> | ||||||||||||||
<LanguageLogo @language={{@language}} @variant="teal" class="h-36 dark:opacity-90" /> | ||||||||||||||
</div> | ||||||||||||||
|
||||||||||||||
<div class="h-px bg-gray-200 dark:bg-white/5 w-full my-8"></div> | ||||||||||||||
</div> |
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -12,118 +12,120 @@ module('Acceptance | track-page | view-track', function (hooks) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
test('it renders for anonymous user', async function (assert) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
testScenario(this.server); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
createTrackLeaderboardEntries(this.server, 'go', 'redis'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
createTrackLeaderboardEntries(this.server, 'rust', 'redis'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
await visit('/tracks/go'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
assert.strictEqual(1, 1); // dummy assertion | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
await visit('/tracks/rust'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
await this.pauseTest(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// assert.strictEqual(1, 1); // dummy assertion | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
await percySnapshot('Track - Anonymous User'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
await visit('/tracks/haskell'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
assert.strictEqual(1, 1); // dummy assertion | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// await percySnapshot('Track - Anonymous User'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+15
to
+22
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove debugging code and restore test assertions. Several issues in the test setup:
- createTrackLeaderboardEntries(this.server, 'rust', 'redis');
- await visit('/tracks/rust');
- await this.pauseTest();
- // assert.strictEqual(1, 1); // dummy assertion
- // await percySnapshot('Track - Anonymous User');
+ createTrackLeaderboardEntries(this.server, 'rust', 'redis');
+ await visit('/tracks/rust');
+
+ assert.strictEqual(trackPage.header.descriptionText, "Rust mastery exercises. Become your team's resident Rust expert.");
+ assert.true(trackPage.header.isVisible, "Header should be visible");
+
+ await percySnapshot('Track - Anonymous User'); 📝 Committable suggestion
Suggested change
🧰 Tools🪛 ESLint[error] 18-18: Do not commit (ember/no-pause-test) [error] 21-22: Delete (prettier/prettier) |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
await percySnapshot('Track (Generic) - Anonymous User'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// await visit('/tracks/haskell'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// assert.strictEqual(1, 1); // dummy assertion | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// await percySnapshot('Track (Generic) - Anonymous User'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
test('it renders the correct description if the track is Go', async function (assert) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
testScenario(this.server); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
createTrackLeaderboardEntries(this.server, 'go', 'redis'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// test('it renders the correct description if the track is Go', async function (assert) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// testScenario(this.server); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// createTrackLeaderboardEntries(this.server, 'go', 'redis'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
await visit('/tracks/go'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// await visit('/tracks/go'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
assert.strictEqual( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
trackPage.header.descriptionText, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
'Achieve mastery in advanced Go, by building real-world projects. Featuring goroutines, systems programming, file I/O, and more.', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// assert.strictEqual( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// trackPage.header.descriptionText, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// 'Achieve mastery in advanced Go, by building real-world projects. Featuring goroutines, systems programming, file I/O, and more.', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
test('it renders the correct description if the track is not Go', async function (assert) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
testScenario(this.server); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
createTrackLeaderboardEntries(this.server, 'go', 'redis'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// test('it renders the correct description if the track is not Go', async function (assert) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// testScenario(this.server); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// createTrackLeaderboardEntries(this.server, 'go', 'redis'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
await visit('/tracks/python'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// await visit('/tracks/python'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
assert.strictEqual(trackPage.header.descriptionText, "Python mastery exercises. Become your team's resident Python expert."); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// assert.strictEqual(trackPage.header.descriptionText, "Python mastery exercises. Become your team's resident Python expert."); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
test('it renders for logged-in user', async function (assert) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
testScenario(this.server); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
signIn(this.owner, this.server); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
createTrackLeaderboardEntries(this.server, 'go', 'redis'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// test('it renders for logged-in user', async function (assert) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// testScenario(this.server); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// signIn(this.owner, this.server); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// createTrackLeaderboardEntries(this.server, 'go', 'redis'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
await visit('/tracks/go'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
assert.strictEqual(1, 1); // dummy assertion | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// await visit('/tracks/go'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// assert.strictEqual(1, 1); // dummy assertion | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
await percySnapshot('Track - Not Started'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// await percySnapshot('Track - Not Started'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
test('it renders for logged-in user who has started course', async function (assert) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
testScenario(this.server); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
signIn(this.owner, this.server); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
createTrackLeaderboardEntries(this.server, 'go', 'redis'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// test('it renders for logged-in user who has started course', async function (assert) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// testScenario(this.server); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// signIn(this.owner, this.server); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// createTrackLeaderboardEntries(this.server, 'go', 'redis'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
let currentUser = this.server.schema.users.first(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
let go = this.server.schema.languages.findBy({ slug: 'go' }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
let redis = this.server.schema.courses.findBy({ slug: 'redis' }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// let currentUser = this.server.schema.users.first(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// let go = this.server.schema.languages.findBy({ slug: 'go' }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// let redis = this.server.schema.courses.findBy({ slug: 'redis' }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
this.server.create('repository', 'withFirstStageCompleted', { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
course: redis, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
language: go, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
user: currentUser, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// this.server.create('repository', 'withFirstStageCompleted', { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// course: redis, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// language: go, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// user: currentUser, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
await visit('/tracks/go'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
assert.strictEqual(1, 1); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// await visit('/tracks/go'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// assert.strictEqual(1, 1); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
await percySnapshot('Track - Started'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// await percySnapshot('Track - Started'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
test('it renders for logged-in user who has finished one course', async function (assert) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
testScenario(this.server, ['dummy', 'sqlite']); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
signIn(this.owner, this.server); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
createTrackLeaderboardEntries(this.server, 'go', 'dummy'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// test('it renders for logged-in user who has finished one course', async function (assert) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// testScenario(this.server, ['dummy', 'sqlite']); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// signIn(this.owner, this.server); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// createTrackLeaderboardEntries(this.server, 'go', 'dummy'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
let currentUser = this.server.schema.users.first(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
let go = this.server.schema.languages.findBy({ slug: 'go' }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
let dummy = this.server.schema.courses.findBy({ slug: 'dummy' }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// let currentUser = this.server.schema.users.first(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// let go = this.server.schema.languages.findBy({ slug: 'go' }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// let dummy = this.server.schema.courses.findBy({ slug: 'dummy' }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
this.server.create('repository', 'withAllStagesCompleted', { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
course: dummy, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
language: go, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
user: currentUser, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// this.server.create('repository', 'withAllStagesCompleted', { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// course: dummy, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// language: go, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// user: currentUser, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
await visit('/tracks/go'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
assert.strictEqual(1, 1); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// await visit('/tracks/go'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// assert.strictEqual(1, 1); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
await percySnapshot('Track - 1 Course Finished'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// await percySnapshot('Track - 1 Course Finished'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
test('it excludes alpha courses', async function (assert) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
testScenario(this.server); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
signIn(this.owner, this.server); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// test('it excludes alpha courses', async function (assert) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// testScenario(this.server); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// signIn(this.owner, this.server); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
await trackPage.visit({ track_slug: 'javascript' }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
assert.notOk(trackPage.cards.mapBy('title').includes('Build your own React')); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// await trackPage.visit({ track_slug: 'javascript' }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// assert.notOk(trackPage.cards.mapBy('title').includes('Build your own React')); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+30
to
+110
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Restore critical test coverage. A significant number of important test cases have been commented out, including:
These tests cover critical user scenarios and edge cases. Instead of removing them, they should be updated to match the new header layout. Would you like me to help update these test cases to work with the new header implementation? |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
test('it does not show a challenge if it is deprecated', async function (assert) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
testScenario(this.server); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
signIn(this.owner, this.server); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
createTrackLeaderboardEntries(this.server, 'go', 'redis'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
let currentUser = this.server.schema.users.first(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
let go = this.server.schema.languages.findBy({ slug: 'go' }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
let docker = this.server.schema.courses.findBy({ slug: 'docker' }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
docker.update({ releaseStatus: 'deprecated' }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
this.server.create('repository', 'withFirstStageCompleted', { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
course: docker, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
language: go, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
user: currentUser, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
await visit('/tracks/go'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
assert.notOk(trackPage.cards.mapBy('title').includes('Build your own Docker')); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// test('it does not show a challenge if it is deprecated', async function (assert) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// testScenario(this.server); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// signIn(this.owner, this.server); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// createTrackLeaderboardEntries(this.server, 'go', 'redis'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// let currentUser = this.server.schema.users.first(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// let go = this.server.schema.languages.findBy({ slug: 'go' }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// let docker = this.server.schema.courses.findBy({ slug: 'docker' }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// docker.update({ releaseStatus: 'deprecated' }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// this.server.create('repository', 'withFirstStageCompleted', { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// course: docker, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// language: go, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// user: currentUser, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// await visit('/tracks/go'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// assert.notOk(trackPage.cards.mapBy('title').includes('Build your own Docker')); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+112
to
+130
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Restore deprecated course visibility test. The test for ensuring deprecated courses are not displayed is important for maintaining correct course visibility rules. This regression test should be updated rather than removed to prevent accidental display of deprecated courses. - // test('it does not show a challenge if it is deprecated', async function (assert) {
+ test('it does not show a challenge if it is deprecated', async function (assert) {
testScenario(this.server);
signIn(this.owner, this.server);
createTrackLeaderboardEntries(this.server, 'go', 'redis');
// ... rest of the test setup ...
await visit('/tracks/go');
- // assert.notOk(trackPage.cards.mapBy('title').includes('Build your own Docker'));
+ assert.notOk(trackPage.cards.mapBy('title').includes('Build your own Docker'), 'Deprecated course should not be visible');
}); 📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codebase verification
Standardize heroicon usage across the codebase
The codebase shows inconsistent usage of the academic-cap icon:
app/components/track-concept-item.hbs
: Usesacademic-cap-outline
app/components/course-card.hbs
: Usesacademic-cap
app/components/tracks-page/track-card.hbs
: Usesacademic-cap
app/components/track-page/header.hbs
: Usesacademic-cap
🔗 Analysis chain
Address TODO comment about heroicons qualification.
The comment indicates a need to qualify heroicons with solid/outline variants.
Run this script to check heroicon usage patterns:
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
Length of output: 40
Script:
Length of output: 10864