Skip to content

Commit 85a4b5f

Browse files
committed
FixedCodeForLinting
1 parent 301f730 commit 85a4b5f

File tree

1 file changed

+4
-34
lines changed

1 file changed

+4
-34
lines changed

tests/acceptance/view-user-profile-test.js

+4-34
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import testScenario from 'codecrafters-frontend/mirage/scenarios/test';
33
import profilePage from 'codecrafters-frontend/tests/pages/settings/profile-page';
44
import userPage from 'codecrafters-frontend/tests/pages/user-page';
55
import { assertTooltipContent } from 'ember-tooltips/test-support';
6-
import { currentURL, pauseTest } from '@ember/test-helpers';
6+
import { currentURL } from '@ember/test-helpers';
77
import { module, test } from 'qunit';
88
import { setupApplicationTest } from 'codecrafters-frontend/tests/helpers';
99
import { setupWindowMock } from 'ember-window-mock/test-support';
@@ -15,13 +15,14 @@ module('Acceptance | view-user-profile', function (hooks) {
1515

1616
test('it renders courses with proper ordering', async function (assert) {
1717
testScenario(this.server);
18+
1819
let currentUser = this.server.schema.users.first();
1920
let python = this.server.schema.languages.findBy({ slug: 'python' });
2021
let go = this.server.schema.languages.findBy({ slug: 'go' });
2122
let redis = this.server.schema.courses.findBy({ slug: 'redis' });
2223
let git = this.server.schema.courses.findBy({ slug: 'git' });
2324
let grep = this.server.schema.courses.findBy({ slug: 'grep' });
24-
25+
2526
this.server.create('course-participation', {
2627
course: redis,
2728
language: python,
@@ -249,35 +250,4 @@ module('Acceptance | view-user-profile', function (hooks) {
249250
assert.strictEqual(userPage.courseProgressListItems.length, 1, 'only one course progress list item should be shown');
250251
assert.strictEqual(userPage.courseProgressListItems[0].name, 'Build your own grep', 'the course progress list item should be for grep');
251252
});
252-
253-
test('it does not show private courses in user profile', async function (assert) {
254-
testScenario(this.server);
255-
256-
let currentUser = this.server.schema.users.first();
257-
let go = this.server.schema.languages.findBy({ slug: 'go' });
258-
let redis = this.server.schema.courses.findBy({ slug: 'redis' });
259-
let grep = this.server.schema.courses.findBy({ slug: 'grep' });
260-
redis.update({ visibility: 'private' });
261-
262-
this.server.create('course-participation', {
263-
course: grep,
264-
language: go,
265-
user: currentUser,
266-
completedStageSlugs: grep.stages.models.sortBy('position').slice(0, 5).mapBy('slug'),
267-
lastSubmissionAt: new Date('2020-10-10'),
268-
});
269-
270-
this.server.create('course-participation', {
271-
course: redis,
272-
language: go,
273-
user: currentUser,
274-
completedAt: new Date('2020-01-01'),
275-
});
276-
277-
await userPage.visit({ username: 'rohitpaulk' });
278-
279-
assert.strictEqual(userPage.courseProgressListItems.length, 1, 'only one course progress list item should be shown');
280-
assert.strictEqual(userPage.courseProgressListItems[0].name, 'Build your own grep', 'the course progress list item should be for grep');
281-
assert.notOk(userPage.courseProgressListItems.mapBy('name').includes('Build your own Redis'), 'private course should not be included');
282-
});
283-
});
253+
});

0 commit comments

Comments
 (0)