{"action":"created","comment":{"url":"https://api.github.com/repos/seventag/seventag/pulls/comments/47657268","id":47657268,"diff_hunk":"@@ -0,0 +1,137 @@\n+/**\n+ * Copyright (C) 2015 Digimedia Sp. z.o.o. d/b/a Clearcode\n+ *\n+ * This program is free software: you can redistribute it and/or modify it under\n+ * the terms of the GNU Affero General Public License as published by the Free\n+ * Software Foundation, either version 3 of the License, or (at your option) any\n+ * later version.\n+ *\n+ * This program is distrubuted in the hope that it will be useful,\n+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\n+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n+ * GNU Affero General Public License for more details.\n+ *\n+ * You should have received a copy of the GNU Affero General Public License\n+ * along with this program. If not, see <http://www.gnu.org/licenses/>.\n+ */\n+'use strict';\n+\n+describe('Unit: DataLayerLimitedStack service', () => {\n+\n+    const MODULE_NAME = 'stg.debugger';\n+\n+    /**\n+     * @var DataLayerLimitedStack\n+     */\n+    let $dataLayerLimitedStack;\n+\n+    beforeEach(module(MODULE_NAME));\n+\n+    beforeEach(() => {\n+        inject(function($injector) {\n+            $dataLayerLimitedStack = $injector.get(`${MODULE_NAME}.dataLayerLimitedStack`);\n+        });\n+    });\n+\n+    it('should be defined', () => {\n+        expect($dataLayerLimitedStack).toBeDefined();\n+    });\n+\n+    describe('method isLimitDefined', () => {\n+\n+        it('should be defined', () => {\n+\n+            expect($dataLayerLimitedStack.isLimitDefined).toBeDefined();\n+\n+        });\n+\n+        it('should return true if we pass limit argument', () => {\n+\n+            var result = $dataLayerLimitedStack.isLimitDefined(10);\n+\n+            expect($dataLayerLimitedStack.isLimitDefined).toHaveBeenCalled();\n+            expect(result).toBe(true);\n+\n+        });\n+\n+        it('should return false if we have undefined limit', () => {\n+\n+            var result = $dataLayerLimitedStack.isLimitDefined(undefined);\n+\n+            expect($dataLayerLimitedStack.isLimitDefined).toHaveBeenCalled();\n+            expect(result).toBe(false);\n+\n+        });\n+    });\n+\n+    describe('method get stack', () => {\n+\n+        it('should be defined', () => {\n+\n+            expect($dataLayerLimitedStack.stack).toBeDefined();\n+\n+        });\n+\n+        it('should return stack array', () => {\n+\n+            var stack = $dataLayerLimitedStack.stack;\n+\n+            expect($dataLayerLimitedStack.stack).toHaveBeenCalled();\n+            expect(stack.length).toBe(0);\n+\n+        });\n+    });\n+\n+    describe('method push', () => {\n+\n+        it('should be defined', () => {\n+\n+            expect($dataLayerLimitedStack.push).toBeDefined();\n+\n+        });\n+\n+        it('should add new element to stack', () => {\n+\n+            $dataLayerLimitedStack.isLimitExceeded(['test']);\n+\n+            expect($dataLayerLimitedStack.push).toHaveBeenCalled();\n+\n+            var stack = $dataLayerLimitedStack.stack;\n+            expect($dataLayerLimitedStack.stack).toHaveBeenCalled();\n+            expect(stack.length).toBe(1);\n+\n+        });\n+    });\n+\n+\n+    describe('method isLimitExceeded', () => {\n+\n+        it('should be defined', () => {\n+\n+            expect($dataLayerLimitedStack.isLimitExceeded).toBeDefined();\n+\n+        });\n+\n+        it('should return false if limit is not exceeded', () => {\n+\n+            var result = $dataLayerLimitedStack.isLimitExceeded();\n+\n+            expect($dataLayerLimitedStack.isLimitExceeded).toHaveBeenCalled();\n+            expect(result).toBe(false);\n+\n+        });\n+\n+        it('should return true if limit is exceeded', () => {\n+\n+            for (var i=0; i<301; i++) {\n+                $dataLayerLimitedStack.push(['test']);\n+            }\n+\n+            var result = $dataLayerLimitedStack.isLimitExceeded();\n+\n+            expect($dataLayerLimitedStack.isLimitExceeded).toHaveBeenCalled();","path":"tests/container-debugger/tests/unit/debugger/service/DataLayerLimitedStack.spec.js","position":132,"original_position":132,"commit_id":"6170ae219c79856daf07b3d95354b04c33cc8fc5","original_commit_id":"6170ae219c79856daf07b3d95354b04c33cc8fc5","user":{"login":"ArekZc","id":3869499,"avatar_url":"https://avatars.githubusercontent.com/u/3869499?v=3","gravatar_id":"","url":"https://api.github.com/users/ArekZc","html_url":"https://github.com/ArekZc","followers_url":"https://api.github.com/users/ArekZc/followers","following_url":"https://api.github.com/users/ArekZc/following{/other_user}","gists_url":"https://api.github.com/users/ArekZc/gists{/gist_id}","starred_url":"https://api.github.com/users/ArekZc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ArekZc/subscriptions","organizations_url":"https://api.github.com/users/ArekZc/orgs","repos_url":"https://api.github.com/users/ArekZc/repos","events_url":"https://api.github.com/users/ArekZc/events{/privacy}","received_events_url":"https://api.github.com/users/ArekZc/received_events","type":"User","site_admin":false},"body":"This assertion test that you call method line upper.","created_at":"2015-12-15T16:10:27Z","updated_at":"2015-12-15T16:10:27Z","html_url":"https://github.com/seventag/seventag/pull/351#discussion_r47657268","pull_request_url":"https://api.github.com/repos/seventag/seventag/pulls/351","_links":{"self":{"href":"https://api.github.com/repos/seventag/seventag/pulls/comments/47657268"},"html":{"href":"https://github.com/seventag/seventag/pull/351#discussion_r47657268"},"pull_request":{"href":"https://api.github.com/repos/seventag/seventag/pulls/351"}}},"pull_request":{"url":"https://api.github.com/repos/seventag/seventag/pulls/351","id":53707769,"html_url":"https://github.com/seventag/seventag/pull/351","diff_url":"https://github.com/seventag/seventag/pull/351.diff","patch_url":"https://github.com/seventag/seventag/pull/351.patch","issue_url":"https://api.github.com/repos/seventag/seventag/issues/351","number":351,"state":"open","locked":false,"title":"TM-1113 change limit, refactor class","user":{"login":"kallosz","id":157952,"avatar_url":"https://avatars.githubusercontent.com/u/157952?v=3","gravatar_id":"","url":"https://api.github.com/users/kallosz","html_url":"https://github.com/kallosz","followers_url":"https://api.github.com/users/kallosz/followers","following_url":"https://api.github.com/users/kallosz/following{/other_user}","gists_url":"https://api.github.com/users/kallosz/gists{/gist_id}","starred_url":"https://api.github.com/users/kallosz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kallosz/subscriptions","organizations_url":"https://api.github.com/users/kallosz/orgs","repos_url":"https://api.github.com/users/kallosz/repos","events_url":"https://api.github.com/users/kallosz/events{/privacy}","received_events_url":"https://api.github.com/users/kallosz/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-12-15T14:13:33Z","updated_at":"2015-12-15T16:10:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3007b847c9a57d018ac8cbab78075d568d67e157","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/seventag/seventag/pulls/351/commits","review_comments_url":"https://api.github.com/repos/seventag/seventag/pulls/351/comments","review_comment_url":"https://api.github.com/repos/seventag/seventag/pulls/comments{/number}","comments_url":"https://api.github.com/repos/seventag/seventag/issues/351/comments","statuses_url":"https://api.github.com/repos/seventag/seventag/statuses/6170ae219c79856daf07b3d95354b04c33cc8fc5","head":{"label":"seventag:feature/TM-1113-change-limit","ref":"feature/TM-1113-change-limit","sha":"6170ae219c79856daf07b3d95354b04c33cc8fc5","user":{"login":"seventag","id":11617285,"avatar_url":"https://avatars.githubusercontent.com/u/11617285?v=3","gravatar_id":"","url":"https://api.github.com/users/seventag","html_url":"https://github.com/seventag","followers_url":"https://api.github.com/users/seventag/followers","following_url":"https://api.github.com/users/seventag/following{/other_user}","gists_url":"https://api.github.com/users/seventag/gists{/gist_id}","starred_url":"https://api.github.com/users/seventag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seventag/subscriptions","organizations_url":"https://api.github.com/users/seventag/orgs","repos_url":"https://api.github.com/users/seventag/repos","events_url":"https://api.github.com/users/seventag/events{/privacy}","received_events_url":"https://api.github.com/users/seventag/received_events","type":"Organization","site_admin":false},"repo":{"id":32939880,"name":"seventag","full_name":"seventag/seventag","owner":{"login":"seventag","id":11617285,"avatar_url":"https://avatars.githubusercontent.com/u/11617285?v=3","gravatar_id":"","url":"https://api.github.com/users/seventag","html_url":"https://github.com/seventag","followers_url":"https://api.github.com/users/seventag/followers","following_url":"https://api.github.com/users/seventag/following{/other_user}","gists_url":"https://api.github.com/users/seventag/gists{/gist_id}","starred_url":"https://api.github.com/users/seventag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seventag/subscriptions","organizations_url":"https://api.github.com/users/seventag/orgs","repos_url":"https://api.github.com/users/seventag/repos","events_url":"https://api.github.com/users/seventag/events{/privacy}","received_events_url":"https://api.github.com/users/seventag/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/seventag/seventag","description":"","fork":false,"url":"https://api.github.com/repos/seventag/seventag","forks_url":"https://api.github.com/repos/seventag/seventag/forks","keys_url":"https://api.github.com/repos/seventag/seventag/keys{/key_id}","collaborators_url":"https://api.github.com/repos/seventag/seventag/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/seventag/seventag/teams","hooks_url":"https://api.github.com/repos/seventag/seventag/hooks","issue_events_url":"https://api.github.com/repos/seventag/seventag/issues/events{/number}","events_url":"https://api.github.com/repos/seventag/seventag/events","assignees_url":"https://api.github.com/repos/seventag/seventag/assignees{/user}","branches_url":"https://api.github.com/repos/seventag/seventag/branches{/branch}","tags_url":"https://api.github.com/repos/seventag/seventag/tags","blobs_url":"https://api.github.com/repos/seventag/seventag/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/seventag/seventag/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/seventag/seventag/git/refs{/sha}","trees_url":"https://api.github.com/repos/seventag/seventag/git/trees{/sha}","statuses_url":"https://api.github.com/repos/seventag/seventag/statuses/{sha}","languages_url":"https://api.github.com/repos/seventag/seventag/languages","stargazers_url":"https://api.github.com/repos/seventag/seventag/stargazers","contributors_url":"https://api.github.com/repos/seventag/seventag/contributors","subscribers_url":"https://api.github.com/repos/seventag/seventag/subscribers","subscription_url":"https://api.github.com/repos/seventag/seventag/subscription","commits_url":"https://api.github.com/repos/seventag/seventag/commits{/sha}","git_commits_url":"https://api.github.com/repos/seventag/seventag/git/commits{/sha}","comments_url":"https://api.github.com/repos/seventag/seventag/comments{/number}","issue_comment_url":"https://api.github.com/repos/seventag/seventag/issues/comments{/number}","contents_url":"https://api.github.com/repos/seventag/seventag/contents/{+path}","compare_url":"https://api.github.com/repos/seventag/seventag/compare/{base}...{head}","merges_url":"https://api.github.com/repos/seventag/seventag/merges","archive_url":"https://api.github.com/repos/seventag/seventag/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/seventag/seventag/downloads","issues_url":"https://api.github.com/repos/seventag/seventag/issues{/number}","pulls_url":"https://api.github.com/repos/seventag/seventag/pulls{/number}","milestones_url":"https://api.github.com/repos/seventag/seventag/milestones{/number}","notifications_url":"https://api.github.com/repos/seventag/seventag/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/seventag/seventag/labels{/name}","releases_url":"https://api.github.com/repos/seventag/seventag/releases{/id}","created_at":"2015-03-26T16:46:33Z","updated_at":"2015-11-23T14:20:43Z","pushed_at":"2015-12-15T15:46:43Z","git_url":"git://github.com/seventag/seventag.git","ssh_url":"git@github.com:seventag/seventag.git","clone_url":"https://github.com/seventag/seventag.git","svn_url":"https://github.com/seventag/seventag","homepage":null,"size":4696,"stargazers_count":10,"watchers_count":10,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":18,"forks":4,"open_issues":18,"watchers":10,"default_branch":"develop"}},"base":{"label":"seventag:release/1.2.0","ref":"release/1.2.0","sha":"e310ba7dd9be0d1dfd4a08bcb4d9d9d3ddd6a7e8","user":{"login":"seventag","id":11617285,"avatar_url":"https://avatars.githubusercontent.com/u/11617285?v=3","gravatar_id":"","url":"https://api.github.com/users/seventag","html_url":"https://github.com/seventag","followers_url":"https://api.github.com/users/seventag/followers","following_url":"https://api.github.com/users/seventag/following{/other_user}","gists_url":"https://api.github.com/users/seventag/gists{/gist_id}","starred_url":"https://api.github.com/users/seventag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seventag/subscriptions","organizations_url":"https://api.github.com/users/seventag/orgs","repos_url":"https://api.github.com/users/seventag/repos","events_url":"https://api.github.com/users/seventag/events{/privacy}","received_events_url":"https://api.github.com/users/seventag/received_events","type":"Organization","site_admin":false},"repo":{"id":32939880,"name":"seventag","full_name":"seventag/seventag","owner":{"login":"seventag","id":11617285,"avatar_url":"https://avatars.githubusercontent.com/u/11617285?v=3","gravatar_id":"","url":"https://api.github.com/users/seventag","html_url":"https://github.com/seventag","followers_url":"https://api.github.com/users/seventag/followers","following_url":"https://api.github.com/users/seventag/following{/other_user}","gists_url":"https://api.github.com/users/seventag/gists{/gist_id}","starred_url":"https://api.github.com/users/seventag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seventag/subscriptions","organizations_url":"https://api.github.com/users/seventag/orgs","repos_url":"https://api.github.com/users/seventag/repos","events_url":"https://api.github.com/users/seventag/events{/privacy}","received_events_url":"https://api.github.com/users/seventag/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/seventag/seventag","description":"","fork":false,"url":"https://api.github.com/repos/seventag/seventag","forks_url":"https://api.github.com/repos/seventag/seventag/forks","keys_url":"https://api.github.com/repos/seventag/seventag/keys{/key_id}","collaborators_url":"https://api.github.com/repos/seventag/seventag/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/seventag/seventag/teams","hooks_url":"https://api.github.com/repos/seventag/seventag/hooks","issue_events_url":"https://api.github.com/repos/seventag/seventag/issues/events{/number}","events_url":"https://api.github.com/repos/seventag/seventag/events","assignees_url":"https://api.github.com/repos/seventag/seventag/assignees{/user}","branches_url":"https://api.github.com/repos/seventag/seventag/branches{/branch}","tags_url":"https://api.github.com/repos/seventag/seventag/tags","blobs_url":"https://api.github.com/repos/seventag/seventag/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/seventag/seventag/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/seventag/seventag/git/refs{/sha}","trees_url":"https://api.github.com/repos/seventag/seventag/git/trees{/sha}","statuses_url":"https://api.github.com/repos/seventag/seventag/statuses/{sha}","languages_url":"https://api.github.com/repos/seventag/seventag/languages","stargazers_url":"https://api.github.com/repos/seventag/seventag/stargazers","contributors_url":"https://api.github.com/repos/seventag/seventag/contributors","subscribers_url":"https://api.github.com/repos/seventag/seventag/subscribers","subscription_url":"https://api.github.com/repos/seventag/seventag/subscription","commits_url":"https://api.github.com/repos/seventag/seventag/commits{/sha}","git_commits_url":"https://api.github.com/repos/seventag/seventag/git/commits{/sha}","comments_url":"https://api.github.com/repos/seventag/seventag/comments{/number}","issue_comment_url":"https://api.github.com/repos/seventag/seventag/issues/comments{/number}","contents_url":"https://api.github.com/repos/seventag/seventag/contents/{+path}","compare_url":"https://api.github.com/repos/seventag/seventag/compare/{base}...{head}","merges_url":"https://api.github.com/repos/seventag/seventag/merges","archive_url":"https://api.github.com/repos/seventag/seventag/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/seventag/seventag/downloads","issues_url":"https://api.github.com/repos/seventag/seventag/issues{/number}","pulls_url":"https://api.github.com/repos/seventag/seventag/pulls{/number}","milestones_url":"https://api.github.com/repos/seventag/seventag/milestones{/number}","notifications_url":"https://api.github.com/repos/seventag/seventag/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/seventag/seventag/labels{/name}","releases_url":"https://api.github.com/repos/seventag/seventag/releases{/id}","created_at":"2015-03-26T16:46:33Z","updated_at":"2015-11-23T14:20:43Z","pushed_at":"2015-12-15T15:46:43Z","git_url":"git://github.com/seventag/seventag.git","ssh_url":"git@github.com:seventag/seventag.git","clone_url":"https://github.com/seventag/seventag.git","svn_url":"https://github.com/seventag/seventag","homepage":null,"size":4696,"stargazers_count":10,"watchers_count":10,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":18,"forks":4,"open_issues":18,"watchers":10,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/seventag/seventag/pulls/351"},"html":{"href":"https://github.com/seventag/seventag/pull/351"},"issue":{"href":"https://api.github.com/repos/seventag/seventag/issues/351"},"comments":{"href":"https://api.github.com/repos/seventag/seventag/issues/351/comments"},"review_comments":{"href":"https://api.github.com/repos/seventag/seventag/pulls/351/comments"},"review_comment":{"href":"https://api.github.com/repos/seventag/seventag/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/seventag/seventag/pulls/351/commits"},"statuses":{"href":"https://api.github.com/repos/seventag/seventag/statuses/6170ae219c79856daf07b3d95354b04c33cc8fc5"}}}}