{"action":"created","comment":{"url":"https://api.github.com/repos/1024pix/pix/pulls/comments/194657646","pull_request_review_id":127865203,"id":194657646,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5NDY1NzY0Ng==","diff_hunk":"@@ -0,0 +1,137 @@\n+import { expect } from 'chai';\n+import { describe, it } from 'mocha';\n+import _ from 'lodash';\n+\n+import ProgressWithCheckpoints from 'pix-live/models/behaviors/assessment-progression/ProgressWithCheckpoints';\n+\n+describe('Unit | Model | Behavior | assessment-progression | ProgressWithCheckpoints', function() {\n+  it('should exists', function() {\n+    const result = ProgressWithCheckpoints;\n+    expect(result).to.be.ok;\n+  });\n+\n+  describe('#answersSinceLastCheckpoints(answers)', function() {\n+\n+    it('should be an array', function() {\n+      // given\n+      const answers = [];\n+\n+      // when\n+      const answersSinceLastCheckpoints = ProgressWithCheckpoints.answersSinceLastCheckpoints(answers);\n+\n+      // then\n+      expect(answersSinceLastCheckpoints).to.deep.equal([]);\n+    });\n+\n+    it('should return answers', function() {\n+      // given\n+      const answers = ['irrelevant content'];\n+\n+      // when\n+      const answersSinceLastCheckpoints = ProgressWithCheckpoints.answersSinceLastCheckpoints(answers);\n+\n+      // then\n+      expect(answersSinceLastCheckpoints).to.deep.equal(answers);\n+    });\n+\n+    it('should only return the last answers', function() {\n+      // given\n+      const answers = _.times(7, () => 'irrelevant content');\n+      const [answer6, answer7] = answers.slice(5);\n+\n+      // when\n+      const answersSinceLastCheckpoints = ProgressWithCheckpoints.answersSinceLastCheckpoints(answers);\n+\n+      // then\n+      expect(answersSinceLastCheckpoints).to.deep.equal([answer6, answer7]);\n+    });\n+\n+    it('should only return the last 5 answers', function() {\n+      // given\n+      const answers = _.times(10, () => 'irrelevant content');\n+      const [answer6, answer7, answer8, answer9, answer10] = answers.slice(5);\n+\n+      // when\n+      const answersSinceLastCheckpoints = ProgressWithCheckpoints.answersSinceLastCheckpoints(answers);\n+\n+      // then\n+      expect(answersSinceLastCheckpoints).to.deep.equal([answer6, answer7, answer8, answer9, answer10]);\n+    });\n+  });\n+\n+  describe('Computed property #progress', function() {\n+\n+    describe('#currentStep property', function() {\n+      it('should start at 1', function() {\n+        // given\n+        const nbAnswers = 0;\n+\n+        // when\n+        const result = ProgressWithCheckpoints.progress(nbAnswers);\n+\n+        // then\n+        expect(result).to.have.property('currentStep', 1);\n+      });\n+\n+      it('should be 2 if we answered once', function() {\n+        // given\n+        const nbAnswers = 1;\n+\n+        // when\n+        const result = ProgressWithCheckpoints.progress(nbAnswers);\n+\n+        // then\n+        expect(result).to.have.property('currentStep', 2);\n+      });\n+\n+      it('should be 3 if we answered twice', function() {\n+        // given\n+        const nbAnswers = 2;\n+\n+        // when\n+        const result = ProgressWithCheckpoints.progress(nbAnswers);\n+\n+        // then\n+        expect(result).to.have.property('currentStep', 3);\n+      });\n+\n+      it('should reset to 1 at the 5th answer', function() {\n+        // given\n+        const nbAnswers = 5;\n+\n+        // when\n+        const result = ProgressWithCheckpoints.progress(nbAnswers);\n+\n+        // then\n+        expect(result).to.have.property('currentStep', 1);\n+      });\n+    });\n+\n+    describe('#maxStep property', function() {\n+      it('should always equal 5', function() {\n+        // given","path":"live/tests/unit/models/behaviors/assessment-progression/ProgressWithCheckpoints-test.js","position":112,"original_position":112,"commit_id":"3c85060829a6635070d31a9fb40fce65790e34a1","original_commit_id":"3c85060829a6635070d31a9fb40fce65790e34a1","user":{"login":"DaRiviere","id":35838565,"node_id":"MDQ6VXNlcjM1ODM4NTY1","avatar_url":"https://avatars0.githubusercontent.com/u/35838565?v=4","gravatar_id":"","url":"https://api.github.com/users/DaRiviere","html_url":"https://github.com/DaRiviere","followers_url":"https://api.github.com/users/DaRiviere/followers","following_url":"https://api.github.com/users/DaRiviere/following{/other_user}","gists_url":"https://api.github.com/users/DaRiviere/gists{/gist_id}","starred_url":"https://api.github.com/users/DaRiviere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DaRiviere/subscriptions","organizations_url":"https://api.github.com/users/DaRiviere/orgs","repos_url":"https://api.github.com/users/DaRiviere/repos","events_url":"https://api.github.com/users/DaRiviere/events{/privacy}","received_events_url":"https://api.github.com/users/DaRiviere/received_events","type":"User","site_admin":false},"body":"delete le `// given`","created_at":"2018-06-12T08:41:39Z","updated_at":"2018-06-12T08:44:54Z","html_url":"https://github.com/1024pix/pix/pull/86#discussion_r194657646","pull_request_url":"https://api.github.com/repos/1024pix/pix/pulls/86","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/1024pix/pix/pulls/comments/194657646"},"html":{"href":"https://github.com/1024pix/pix/pull/86#discussion_r194657646"},"pull_request":{"href":"https://api.github.com/repos/1024pix/pix/pulls/86"}}},"pull_request":{"url":"https://api.github.com/repos/1024pix/pix/pulls/86","id":192742680,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkyNzQyNjgw","html_url":"https://github.com/1024pix/pix/pull/86","diff_url":"https://github.com/1024pix/pix/pull/86.diff","patch_url":"https://github.com/1024pix/pix/pull/86.patch","issue_url":"https://api.github.com/repos/1024pix/pix/issues/86","number":86,"state":"open","locked":false,"title":"[#86] [FEATURE] Barre de progression dans un test Smart Placement (PF-72).","user":{"login":"mackwic","id":558091,"node_id":"MDQ6VXNlcjU1ODA5MQ==","avatar_url":"https://avatars1.githubusercontent.com/u/558091?v=4","gravatar_id":"","url":"https://api.github.com/users/mackwic","html_url":"https://github.com/mackwic","followers_url":"https://api.github.com/users/mackwic/followers","following_url":"https://api.github.com/users/mackwic/following{/other_user}","gists_url":"https://api.github.com/users/mackwic/gists{/gist_id}","starred_url":"https://api.github.com/users/mackwic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mackwic/subscriptions","organizations_url":"https://api.github.com/users/mackwic/orgs","repos_url":"https://api.github.com/users/mackwic/repos","events_url":"https://api.github.com/users/mackwic/events{/privacy}","received_events_url":"https://api.github.com/users/mackwic/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-06-05T15:11:58Z","updated_at":"2018-06-12T08:44:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"93632d4820044cd4a2309f3ee86600c2abe75ace","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":881366934,"node_id":"MDU6TGFiZWw4ODEzNjY5MzQ=","url":"https://api.github.com/repos/1024pix/pix/labels/[Func]%20Review%20asked","name":"[Func] Review asked","color":"5319e7","default":false},{"id":881368317,"node_id":"MDU6TGFiZWw4ODEzNjgzMTc=","url":"https://api.github.com/repos/1024pix/pix/labels/[Tech]%20Changes%20validated","name":"[Tech] Changes validated","color":"0e8a16","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/1024pix/pix/pulls/86/commits","review_comments_url":"https://api.github.com/repos/1024pix/pix/pulls/86/comments","review_comment_url":"https://api.github.com/repos/1024pix/pix/pulls/comments{/number}","comments_url":"https://api.github.com/repos/1024pix/pix/issues/86/comments","statuses_url":"https://api.github.com/repos/1024pix/pix/statuses/3c85060829a6635070d31a9fb40fce65790e34a1","head":{"label":"1024pix:pf-72-smart-random-progress-bar","ref":"pf-72-smart-random-progress-bar","sha":"3c85060829a6635070d31a9fb40fce65790e34a1","user":{"login":"1024pix","id":24589578,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI0NTg5NTc4","avatar_url":"https://avatars0.githubusercontent.com/u/24589578?v=4","gravatar_id":"","url":"https://api.github.com/users/1024pix","html_url":"https://github.com/1024pix","followers_url":"https://api.github.com/users/1024pix/followers","following_url":"https://api.github.com/users/1024pix/following{/other_user}","gists_url":"https://api.github.com/users/1024pix/gists{/gist_id}","starred_url":"https://api.github.com/users/1024pix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/1024pix/subscriptions","organizations_url":"https://api.github.com/users/1024pix/orgs","repos_url":"https://api.github.com/users/1024pix/repos","events_url":"https://api.github.com/users/1024pix/events{/privacy}","received_events_url":"https://api.github.com/users/1024pix/received_events","type":"Organization","site_admin":false},"repo":{"id":126852331,"node_id":"MDEwOlJlcG9zaXRvcnkxMjY4NTIzMzE=","name":"pix","full_name":"1024pix/pix","owner":{"login":"1024pix","id":24589578,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI0NTg5NTc4","avatar_url":"https://avatars0.githubusercontent.com/u/24589578?v=4","gravatar_id":"","url":"https://api.github.com/users/1024pix","html_url":"https://github.com/1024pix","followers_url":"https://api.github.com/users/1024pix/followers","following_url":"https://api.github.com/users/1024pix/following{/other_user}","gists_url":"https://api.github.com/users/1024pix/gists{/gist_id}","starred_url":"https://api.github.com/users/1024pix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/1024pix/subscriptions","organizations_url":"https://api.github.com/users/1024pix/orgs","repos_url":"https://api.github.com/users/1024pix/repos","events_url":"https://api.github.com/users/1024pix/events{/privacy}","received_events_url":"https://api.github.com/users/1024pix/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/1024pix/pix","description":"Plateforme d'évaluation et de certification des compétences numériques à l'usage de tous les citoyens francophones.","fork":false,"url":"https://api.github.com/repos/1024pix/pix","forks_url":"https://api.github.com/repos/1024pix/pix/forks","keys_url":"https://api.github.com/repos/1024pix/pix/keys{/key_id}","collaborators_url":"https://api.github.com/repos/1024pix/pix/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/1024pix/pix/teams","hooks_url":"https://api.github.com/repos/1024pix/pix/hooks","issue_events_url":"https://api.github.com/repos/1024pix/pix/issues/events{/number}","events_url":"https://api.github.com/repos/1024pix/pix/events","assignees_url":"https://api.github.com/repos/1024pix/pix/assignees{/user}","branches_url":"https://api.github.com/repos/1024pix/pix/branches{/branch}","tags_url":"https://api.github.com/repos/1024pix/pix/tags","blobs_url":"https://api.github.com/repos/1024pix/pix/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/1024pix/pix/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/1024pix/pix/git/refs{/sha}","trees_url":"https://api.github.com/repos/1024pix/pix/git/trees{/sha}","statuses_url":"https://api.github.com/repos/1024pix/pix/statuses/{sha}","languages_url":"https://api.github.com/repos/1024pix/pix/languages","stargazers_url":"https://api.github.com/repos/1024pix/pix/stargazers","contributors_url":"https://api.github.com/repos/1024pix/pix/contributors","subscribers_url":"https://api.github.com/repos/1024pix/pix/subscribers","subscription_url":"https://api.github.com/repos/1024pix/pix/subscription","commits_url":"https://api.github.com/repos/1024pix/pix/commits{/sha}","git_commits_url":"https://api.github.com/repos/1024pix/pix/git/commits{/sha}","comments_url":"https://api.github.com/repos/1024pix/pix/comments{/number}","issue_comment_url":"https://api.github.com/repos/1024pix/pix/issues/comments{/number}","contents_url":"https://api.github.com/repos/1024pix/pix/contents/{+path}","compare_url":"https://api.github.com/repos/1024pix/pix/compare/{base}...{head}","merges_url":"https://api.github.com/repos/1024pix/pix/merges","archive_url":"https://api.github.com/repos/1024pix/pix/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/1024pix/pix/downloads","issues_url":"https://api.github.com/repos/1024pix/pix/issues{/number}","pulls_url":"https://api.github.com/repos/1024pix/pix/pulls{/number}","milestones_url":"https://api.github.com/repos/1024pix/pix/milestones{/number}","notifications_url":"https://api.github.com/repos/1024pix/pix/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/1024pix/pix/labels{/name}","releases_url":"https://api.github.com/repos/1024pix/pix/releases{/id}","deployments_url":"https://api.github.com/repos/1024pix/pix/deployments","created_at":"2018-03-26T15:47:12Z","updated_at":"2018-06-11T15:48:28Z","pushed_at":"2018-06-12T08:43:18Z","git_url":"git://github.com/1024pix/pix.git","ssh_url":"git@github.com:1024pix/pix.git","clone_url":"https://github.com/1024pix/pix.git","svn_url":"https://github.com/1024pix/pix","homepage":"https://pix.fr","size":159970,"stargazers_count":12,"watchers_count":12,"language":"JavaScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":2,"mirror_url":null,"archived":false,"open_issues_count":5,"license":{"key":"agpl-3.0","name":"GNU Affero General Public License v3.0","spdx_id":"AGPL-3.0","url":"https://api.github.com/licenses/agpl-3.0","node_id":"MDc6TGljZW5zZTE="},"forks":2,"open_issues":5,"watchers":12,"default_branch":"dev"}},"base":{"label":"1024pix:dev","ref":"dev","sha":"1f83a226c10f443cfcdcce07cf47fe7c1656bb1b","user":{"login":"1024pix","id":24589578,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI0NTg5NTc4","avatar_url":"https://avatars0.githubusercontent.com/u/24589578?v=4","gravatar_id":"","url":"https://api.github.com/users/1024pix","html_url":"https://github.com/1024pix","followers_url":"https://api.github.com/users/1024pix/followers","following_url":"https://api.github.com/users/1024pix/following{/other_user}","gists_url":"https://api.github.com/users/1024pix/gists{/gist_id}","starred_url":"https://api.github.com/users/1024pix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/1024pix/subscriptions","organizations_url":"https://api.github.com/users/1024pix/orgs","repos_url":"https://api.github.com/users/1024pix/repos","events_url":"https://api.github.com/users/1024pix/events{/privacy}","received_events_url":"https://api.github.com/users/1024pix/received_events","type":"Organization","site_admin":false},"repo":{"id":126852331,"node_id":"MDEwOlJlcG9zaXRvcnkxMjY4NTIzMzE=","name":"pix","full_name":"1024pix/pix","owner":{"login":"1024pix","id":24589578,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI0NTg5NTc4","avatar_url":"https://avatars0.githubusercontent.com/u/24589578?v=4","gravatar_id":"","url":"https://api.github.com/users/1024pix","html_url":"https://github.com/1024pix","followers_url":"https://api.github.com/users/1024pix/followers","following_url":"https://api.github.com/users/1024pix/following{/other_user}","gists_url":"https://api.github.com/users/1024pix/gists{/gist_id}","starred_url":"https://api.github.com/users/1024pix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/1024pix/subscriptions","organizations_url":"https://api.github.com/users/1024pix/orgs","repos_url":"https://api.github.com/users/1024pix/repos","events_url":"https://api.github.com/users/1024pix/events{/privacy}","received_events_url":"https://api.github.com/users/1024pix/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/1024pix/pix","description":"Plateforme d'évaluation et de certification des compétences numériques à l'usage de tous les citoyens francophones.","fork":false,"url":"https://api.github.com/repos/1024pix/pix","forks_url":"https://api.github.com/repos/1024pix/pix/forks","keys_url":"https://api.github.com/repos/1024pix/pix/keys{/key_id}","collaborators_url":"https://api.github.com/repos/1024pix/pix/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/1024pix/pix/teams","hooks_url":"https://api.github.com/repos/1024pix/pix/hooks","issue_events_url":"https://api.github.com/repos/1024pix/pix/issues/events{/number}","events_url":"https://api.github.com/repos/1024pix/pix/events","assignees_url":"https://api.github.com/repos/1024pix/pix/assignees{/user}","branches_url":"https://api.github.com/repos/1024pix/pix/branches{/branch}","tags_url":"https://api.github.com/repos/1024pix/pix/tags","blobs_url":"https://api.github.com/repos/1024pix/pix/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/1024pix/pix/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/1024pix/pix/git/refs{/sha}","trees_url":"https://api.github.com/repos/1024pix/pix/git/trees{/sha}","statuses_url":"https://api.github.com/repos/1024pix/pix/statuses/{sha}","languages_url":"https://api.github.com/repos/1024pix/pix/languages","stargazers_url":"https://api.github.com/repos/1024pix/pix/stargazers","contributors_url":"https://api.github.com/repos/1024pix/pix/contributors","subscribers_url":"https://api.github.com/repos/1024pix/pix/subscribers","subscription_url":"https://api.github.com/repos/1024pix/pix/subscription","commits_url":"https://api.github.com/repos/1024pix/pix/commits{/sha}","git_commits_url":"https://api.github.com/repos/1024pix/pix/git/commits{/sha}","comments_url":"https://api.github.com/repos/1024pix/pix/comments{/number}","issue_comment_url":"https://api.github.com/repos/1024pix/pix/issues/comments{/number}","contents_url":"https://api.github.com/repos/1024pix/pix/contents/{+path}","compare_url":"https://api.github.com/repos/1024pix/pix/compare/{base}...{head}","merges_url":"https://api.github.com/repos/1024pix/pix/merges","archive_url":"https://api.github.com/repos/1024pix/pix/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/1024pix/pix/downloads","issues_url":"https://api.github.com/repos/1024pix/pix/issues{/number}","pulls_url":"https://api.github.com/repos/1024pix/pix/pulls{/number}","milestones_url":"https://api.github.com/repos/1024pix/pix/milestones{/number}","notifications_url":"https://api.github.com/repos/1024pix/pix/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/1024pix/pix/labels{/name}","releases_url":"https://api.github.com/repos/1024pix/pix/releases{/id}","deployments_url":"https://api.github.com/repos/1024pix/pix/deployments","created_at":"2018-03-26T15:47:12Z","updated_at":"2018-06-11T15:48:28Z","pushed_at":"2018-06-12T08:43:18Z","git_url":"git://github.com/1024pix/pix.git","ssh_url":"git@github.com:1024pix/pix.git","clone_url":"https://github.com/1024pix/pix.git","svn_url":"https://github.com/1024pix/pix","homepage":"https://pix.fr","size":159970,"stargazers_count":12,"watchers_count":12,"language":"JavaScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":2,"mirror_url":null,"archived":false,"open_issues_count":5,"license":{"key":"agpl-3.0","name":"GNU Affero General Public License v3.0","spdx_id":"AGPL-3.0","url":"https://api.github.com/licenses/agpl-3.0","node_id":"MDc6TGljZW5zZTE="},"forks":2,"open_issues":5,"watchers":12,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/1024pix/pix/pulls/86"},"html":{"href":"https://github.com/1024pix/pix/pull/86"},"issue":{"href":"https://api.github.com/repos/1024pix/pix/issues/86"},"comments":{"href":"https://api.github.com/repos/1024pix/pix/issues/86/comments"},"review_comments":{"href":"https://api.github.com/repos/1024pix/pix/pulls/86/comments"},"review_comment":{"href":"https://api.github.com/repos/1024pix/pix/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/1024pix/pix/pulls/86/commits"},"statuses":{"href":"https://api.github.com/repos/1024pix/pix/statuses/3c85060829a6635070d31a9fb40fce65790e34a1"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"DaRiviere"}}