@testgorilla/tgo-coding-test 2.0.0 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (255) hide show
  1. package/fesm2022/testgorilla-tgo-coding-test.mjs +4526 -0
  2. package/fesm2022/testgorilla-tgo-coding-test.mjs.map +1 -0
  3. package/{src/index.ts → index.d.ts} +2 -19
  4. package/lib/components/code-editor/code-editor.component.d.ts +54 -0
  5. package/lib/components/code-editor/code-editor.service.d.ts +12 -0
  6. package/lib/components/code-editor/helpers/c-helper.d.ts +11 -0
  7. package/lib/components/code-editor/helpers/code-editor-helper.base.d.ts +8 -0
  8. package/lib/components/code-editor/helpers/code-editor-helper.model.d.ts +62 -0
  9. package/lib/components/code-editor/helpers/cpp-helper.d.ts +11 -0
  10. package/lib/components/code-editor/helpers/csharp-helper.d.ts +12 -0
  11. package/lib/components/code-editor/helpers/go-helper.d.ts +12 -0
  12. package/lib/components/code-editor/helpers/java-helper.d.ts +12 -0
  13. package/lib/components/code-editor/helpers/javascript-helper.d.ts +10 -0
  14. package/lib/components/code-editor/helpers/kotlin-helper.d.ts +12 -0
  15. package/lib/components/code-editor/helpers/php-helper.d.ts +10 -0
  16. package/lib/components/code-editor/helpers/python-helper.d.ts +10 -0
  17. package/lib/components/code-editor/helpers/r-helper.d.ts +10 -0
  18. package/lib/components/code-editor/helpers/ruby-helper.d.ts +10 -0
  19. package/lib/components/code-editor/helpers/scala-helper.d.ts +12 -0
  20. package/lib/components/code-editor/helpers/sql-helper.d.ts +10 -0
  21. package/lib/components/code-editor/helpers/swift-helper.d.ts +11 -0
  22. package/lib/components/code-editor/helpers/typescript-helper.d.ts +11 -0
  23. package/lib/components/code-editor/models/code-editor.model.d.ts +8 -0
  24. package/lib/components/code-editor/models/coding-snapshot.model.d.ts +4 -0
  25. package/lib/components/coding-question/coding-question.component.d.ts +45 -0
  26. package/lib/components/coding-section/coding-section.component.d.ts +52 -0
  27. package/lib/components/common/truncated-text/truncated-text.component.d.ts +13 -0
  28. package/lib/components/configurations/configurations.component.d.ts +40 -0
  29. package/lib/components/instructions/instructions.component.d.ts +48 -0
  30. package/lib/components/panel/panel.component.d.ts +12 -0
  31. package/lib/components/runnable-editor/runnable-editor.component.d.ts +53 -0
  32. package/lib/components/tests/test-cases/test-cases.component.d.ts +46 -0
  33. package/lib/components/tests/test-cases-content/test-cases-content.component.d.ts +26 -0
  34. package/lib/components/tests/test-cases-status/test-cases-status.component.d.ts +9 -0
  35. package/lib/components/tests/test-results.component.d.ts +33 -0
  36. package/lib/components/tgo-coding-test/tgo-coding-test.component.d.ts +69 -0
  37. package/lib/components/tgo-coding-test-candidate-view/tgo-coding-test-candidate-view.component.d.ts +101 -0
  38. package/{src/lib/config/index.ts → lib/config/index.d.ts} +0 -1
  39. package/lib/config/tgo-coding-test.config.d.ts +24 -0
  40. package/{src/lib/config/tgo-coding-test.provider.ts → lib/config/tgo-coding-test.provider.d.ts} +6 -18
  41. package/lib/config/tgo-coding-test.token.d.ts +9 -0
  42. package/lib/models/auto-saved-data.d.ts +42 -0
  43. package/lib/models/code-event.d.ts +15 -0
  44. package/lib/models/coderunner-execution-results.d.ts +51 -0
  45. package/lib/models/configs.d.ts +15 -0
  46. package/lib/models/language-change-action.d.ts +4 -0
  47. package/lib/models/lat-languages.d.ts +8 -0
  48. package/lib/models/mixpanel-events.d.ts +3 -0
  49. package/lib/models/mode.d.ts +5 -0
  50. package/lib/models/paste-data.d.ts +4 -0
  51. package/lib/models/programming-language.d.ts +8 -0
  52. package/lib/models/test-cases.d.ts +67 -0
  53. package/lib/models/theme.d.ts +4 -0
  54. package/lib/models/translations.d.ts +1 -0
  55. package/lib/models/view-mode.d.ts +6 -0
  56. package/{src/lib/pipes/memoize-func.pipe.ts → lib/pipes/memoize-func.pipe.d.ts} +6 -14
  57. package/lib/services/candidate-coding-test-services/candidature-api.service.d.ts +10 -0
  58. package/lib/services/candidate-coding-test-services/coderunner-api.service.d.ts +18 -0
  59. package/lib/services/candidate-coding-test-services/coding-test-tour.service.d.ts +22 -0
  60. package/lib/services/candidate-coding-test-services/coding-test.service.d.ts +68 -0
  61. package/{src/lib/services/candidate-coding-test-services/index.ts → lib/services/candidate-coding-test-services/index.d.ts} +1 -1
  62. package/lib/services/coding-test-config.service.d.ts +38 -0
  63. package/lib/services/configurations.service.d.ts +37 -0
  64. package/lib/services/lib-coding-test.service.d.ts +69 -0
  65. package/lib/services/storage.service.d.ts +83 -0
  66. package/lib/services/test-cases.service.d.ts +12 -0
  67. package/lib/services/theme.service.d.ts +17 -0
  68. package/lib/utils/additional-languages/erlang.d.ts +37 -0
  69. package/lib/utils/resize-element.d.ts +2 -0
  70. package/lib/utils/time-to-ms.util.d.ts +1 -0
  71. package/package.json +17 -3
  72. package/shared/index.d.ts +4 -0
  73. package/shared/lib/components/audio-animation/audio-animation.component.d.ts +27 -0
  74. package/shared/lib/components/audio-animation/index.d.ts +1 -0
  75. package/shared/lib/components/index.d.ts +2 -0
  76. package/shared/lib/components/vimeo-video/index.d.ts +1 -0
  77. package/shared/lib/components/vimeo-video/vimeo-video.component.d.ts +24 -0
  78. package/shared/lib/models/answer.d.ts +17 -0
  79. package/shared/lib/models/assessment.d.ts +80 -0
  80. package/shared/lib/models/environment.d.ts +1 -0
  81. package/shared/lib/models/index.d.ts +8 -0
  82. package/shared/lib/models/question-component.d.ts +54 -0
  83. package/shared/lib/models/question.d.ts +102 -0
  84. package/shared/lib/models/test.d.ts +81 -0
  85. package/shared/lib/models/translations.d.ts +1 -0
  86. package/shared/lib/models/window.d.ts +6 -0
  87. package/shared/lib/services/api/api.service.d.ts +25 -0
  88. package/shared/lib/services/api/mocked-api.service.d.ts +35 -0
  89. package/shared/lib/services/environment/environment.service.d.ts +6 -0
  90. package/shared/lib/services/index.d.ts +9 -0
  91. package/shared/lib/services/localization/languages.model.d.ts +15 -0
  92. package/shared/lib/services/localization/transloco-lazy-module-utils.d.ts +11 -0
  93. package/shared/lib/services/localization/transloco-testing.module.d.ts +2 -0
  94. package/shared/lib/services/media/media.service.d.ts +29 -0
  95. package/shared/lib/services/mixpanel/mixpanel.service.d.ts +10 -0
  96. package/shared/lib/services/theme/theme.service.d.ts +8 -0
  97. package/shared/test-mocks/assessment-test.mock.d.ts +21 -0
  98. package/shared/test-mocks/index.d.ts +2 -0
  99. package/shared/test-mocks/tgo-ui.mock.d.ts +21 -0
  100. package/.eslintrc.json +0 -46
  101. package/jest.config.ts +0 -26
  102. package/ng-package.json +0 -14
  103. package/project.json +0 -48
  104. package/src/lib/components/.gitkeep +0 -0
  105. package/src/lib/components/code-editor/code-editor.component.html +0 -10
  106. package/src/lib/components/code-editor/code-editor.component.scss +0 -21
  107. package/src/lib/components/code-editor/code-editor.component.spec.ts +0 -136
  108. package/src/lib/components/code-editor/code-editor.component.ts +0 -368
  109. package/src/lib/components/code-editor/code-editor.mocks.ts +0 -28
  110. package/src/lib/components/code-editor/code-editor.service.spec.ts +0 -160
  111. package/src/lib/components/code-editor/code-editor.service.ts +0 -94
  112. package/src/lib/components/code-editor/helpers/c-helper.spec.ts +0 -39
  113. package/src/lib/components/code-editor/helpers/c-helper.ts +0 -51
  114. package/src/lib/components/code-editor/helpers/code-editor-helper.base.spec.ts +0 -30
  115. package/src/lib/components/code-editor/helpers/code-editor-helper.base.ts +0 -16
  116. package/src/lib/components/code-editor/helpers/code-editor-helper.mocks.ts +0 -24
  117. package/src/lib/components/code-editor/helpers/code-editor-helper.model.ts +0 -67
  118. package/src/lib/components/code-editor/helpers/cpp-helper.spec.ts +0 -40
  119. package/src/lib/components/code-editor/helpers/cpp-helper.ts +0 -52
  120. package/src/lib/components/code-editor/helpers/csharp-helper.spec.ts +0 -42
  121. package/src/lib/components/code-editor/helpers/csharp-helper.ts +0 -55
  122. package/src/lib/components/code-editor/helpers/go-helper.spec.ts +0 -41
  123. package/src/lib/components/code-editor/helpers/go-helper.ts +0 -54
  124. package/src/lib/components/code-editor/helpers/java-helper.spec.ts +0 -41
  125. package/src/lib/components/code-editor/helpers/java-helper.ts +0 -54
  126. package/src/lib/components/code-editor/helpers/javascript-helper.spec.ts +0 -39
  127. package/src/lib/components/code-editor/helpers/javascript-helper.ts +0 -32
  128. package/src/lib/components/code-editor/helpers/kotlin-helper.spec.ts +0 -41
  129. package/src/lib/components/code-editor/helpers/kotlin-helper.ts +0 -54
  130. package/src/lib/components/code-editor/helpers/php-helper.spec.ts +0 -39
  131. package/src/lib/components/code-editor/helpers/php-helper.ts +0 -32
  132. package/src/lib/components/code-editor/helpers/python-helper.spec.ts +0 -39
  133. package/src/lib/components/code-editor/helpers/python-helper.ts +0 -32
  134. package/src/lib/components/code-editor/helpers/r-helper.spec.ts +0 -39
  135. package/src/lib/components/code-editor/helpers/r-helper.ts +0 -32
  136. package/src/lib/components/code-editor/helpers/ruby-helper.spec.ts +0 -39
  137. package/src/lib/components/code-editor/helpers/ruby-helper.ts +0 -32
  138. package/src/lib/components/code-editor/helpers/scala-helper.spec.ts +0 -41
  139. package/src/lib/components/code-editor/helpers/scala-helper.ts +0 -53
  140. package/src/lib/components/code-editor/helpers/sql-helper.spec.ts +0 -87
  141. package/src/lib/components/code-editor/helpers/sql-helper.ts +0 -44
  142. package/src/lib/components/code-editor/helpers/swift-helper.spec.ts +0 -40
  143. package/src/lib/components/code-editor/helpers/swift-helper.ts +0 -51
  144. package/src/lib/components/code-editor/helpers/typescript-helper.spec.ts +0 -40
  145. package/src/lib/components/code-editor/helpers/typescript-helper.ts +0 -52
  146. package/src/lib/components/code-editor/models/code-editor.model.ts +0 -9
  147. package/src/lib/components/code-editor/models/coding-snapshot.model.ts +0 -4
  148. package/src/lib/components/coding-question/coding-question.component.html +0 -78
  149. package/src/lib/components/coding-question/coding-question.component.scss +0 -75
  150. package/src/lib/components/coding-question/coding-question.component.spec.ts +0 -85
  151. package/src/lib/components/coding-question/coding-question.component.ts +0 -101
  152. package/src/lib/components/coding-section/coding-section.component.html +0 -82
  153. package/src/lib/components/coding-section/coding-section.component.scss +0 -64
  154. package/src/lib/components/coding-section/coding-section.component.spec.ts +0 -257
  155. package/src/lib/components/coding-section/coding-section.component.ts +0 -186
  156. package/src/lib/components/coding-test.module.ts +0 -124
  157. package/src/lib/components/common/truncated-text/truncated-text.component.html +0 -6
  158. package/src/lib/components/common/truncated-text/truncated-text.component.scss +0 -18
  159. package/src/lib/components/common/truncated-text/truncated-text.component.spec.ts +0 -84
  160. package/src/lib/components/common/truncated-text/truncated-text.component.ts +0 -36
  161. package/src/lib/components/configurations/configurations.component.html +0 -57
  162. package/src/lib/components/configurations/configurations.component.scss +0 -42
  163. package/src/lib/components/configurations/configurations.component.spec.ts +0 -186
  164. package/src/lib/components/configurations/configurations.component.ts +0 -97
  165. package/src/lib/components/instructions/instructions.component.html +0 -41
  166. package/src/lib/components/instructions/instructions.component.scss +0 -173
  167. package/src/lib/components/instructions/instructions.component.spec.ts +0 -106
  168. package/src/lib/components/instructions/instructions.component.ts +0 -137
  169. package/src/lib/components/panel/panel.component.html +0 -19
  170. package/src/lib/components/panel/panel.component.scss +0 -41
  171. package/src/lib/components/panel/panel.component.spec.ts +0 -40
  172. package/src/lib/components/panel/panel.component.ts +0 -33
  173. package/src/lib/components/runnable-editor/runnable-editor.component.html +0 -75
  174. package/src/lib/components/runnable-editor/runnable-editor.component.scss +0 -55
  175. package/src/lib/components/runnable-editor/runnable-editor.component.spec.ts +0 -124
  176. package/src/lib/components/runnable-editor/runnable-editor.component.ts +0 -154
  177. package/src/lib/components/tests/test-cases/test-cases.component.html +0 -135
  178. package/src/lib/components/tests/test-cases/test-cases.component.scss +0 -220
  179. package/src/lib/components/tests/test-cases/test-cases.component.spec.ts +0 -401
  180. package/src/lib/components/tests/test-cases/test-cases.component.ts +0 -204
  181. package/src/lib/components/tests/test-cases-content/test-cases-content.component.html +0 -94
  182. package/src/lib/components/tests/test-cases-content/test-cases-content.component.scss +0 -103
  183. package/src/lib/components/tests/test-cases-content/test-cases-content.component.spec.ts +0 -122
  184. package/src/lib/components/tests/test-cases-content/test-cases-content.component.ts +0 -101
  185. package/src/lib/components/tests/test-cases-status/test-cases-status.component.html +0 -16
  186. package/src/lib/components/tests/test-cases-status/test-cases-status.component.scss +0 -49
  187. package/src/lib/components/tests/test-cases-status/test-cases-status.component.spec.ts +0 -22
  188. package/src/lib/components/tests/test-cases-status/test-cases-status.component.ts +0 -17
  189. package/src/lib/components/tests/test-results.component.html +0 -119
  190. package/src/lib/components/tests/test-results.component.scss +0 -189
  191. package/src/lib/components/tests/test-results.component.spec.ts +0 -140
  192. package/src/lib/components/tests/test-results.component.ts +0 -97
  193. package/src/lib/components/tgo-coding-test/tgo-coding-test.component.html +0 -96
  194. package/src/lib/components/tgo-coding-test/tgo-coding-test.component.scss +0 -6
  195. package/src/lib/components/tgo-coding-test/tgo-coding-test.component.spec.ts +0 -599
  196. package/src/lib/components/tgo-coding-test/tgo-coding-test.component.ts +0 -278
  197. package/src/lib/components/tgo-coding-test-candidate-view/tgo-coding-test-candidate-view.component.html +0 -36
  198. package/src/lib/components/tgo-coding-test-candidate-view/tgo-coding-test-candidate-view.component.scss +0 -183
  199. package/src/lib/components/tgo-coding-test-candidate-view/tgo-coding-test-candidate-view.component.spec.ts +0 -883
  200. package/src/lib/components/tgo-coding-test-candidate-view/tgo-coding-test-candidate-view.component.ts +0 -578
  201. package/src/lib/config/tgo-coding-test.config.ts +0 -26
  202. package/src/lib/config/tgo-coding-test.token.ts +0 -21
  203. package/src/lib/models/.gitkeep +0 -0
  204. package/src/lib/models/auto-saved-data.ts +0 -51
  205. package/src/lib/models/code-event.ts +0 -17
  206. package/src/lib/models/coderunner-execution-results.ts +0 -58
  207. package/src/lib/models/coding-lib.mocks.ts +0 -246
  208. package/src/lib/models/configs.ts +0 -18
  209. package/src/lib/models/language-change-action.ts +0 -4
  210. package/src/lib/models/lat-languages.ts +0 -12
  211. package/src/lib/models/mixpanel-events.ts +0 -3
  212. package/src/lib/models/mode.ts +0 -5
  213. package/src/lib/models/paste-data.ts +0 -4
  214. package/src/lib/models/programming-language.ts +0 -9
  215. package/src/lib/models/test-cases.ts +0 -74
  216. package/src/lib/models/theme.ts +0 -5
  217. package/src/lib/models/translations.ts +0 -1
  218. package/src/lib/models/view-mode.ts +0 -6
  219. package/src/lib/services/.gitkeep +0 -0
  220. package/src/lib/services/candidate-coding-test-services/candidature-api.service.spec.ts +0 -40
  221. package/src/lib/services/candidate-coding-test-services/candidature-api.service.ts +0 -15
  222. package/src/lib/services/candidate-coding-test-services/coderunner-api.service.spec.ts +0 -134
  223. package/src/lib/services/candidate-coding-test-services/coderunner-api.service.ts +0 -105
  224. package/src/lib/services/candidate-coding-test-services/coding-test-tour.service.spec.ts +0 -161
  225. package/src/lib/services/candidate-coding-test-services/coding-test-tour.service.ts +0 -100
  226. package/src/lib/services/candidate-coding-test-services/coding-test.service.spec.ts +0 -1524
  227. package/src/lib/services/candidate-coding-test-services/coding-test.service.ts +0 -843
  228. package/src/lib/services/coding-test-config.service.ts +0 -48
  229. package/src/lib/services/configurations.service.mocks.ts +0 -77
  230. package/src/lib/services/configurations.service.spec.ts +0 -79
  231. package/src/lib/services/configurations.service.ts +0 -111
  232. package/src/lib/services/index.ts +0 -0
  233. package/src/lib/services/lib-coding-test.service.spec.ts +0 -265
  234. package/src/lib/services/lib-coding-test.service.ts +0 -157
  235. package/src/lib/services/local-storage.service.mocks.ts +0 -22
  236. package/src/lib/services/storage.service.spec.ts +0 -1119
  237. package/src/lib/services/storage.service.ts +0 -729
  238. package/src/lib/services/test-cases.service.spec.ts +0 -53
  239. package/src/lib/services/test-cases.service.ts +0 -29
  240. package/src/lib/services/theme.service.spec.ts +0 -76
  241. package/src/lib/services/theme.service.ts +0 -34
  242. package/src/lib/styles/mixins.scss +0 -86
  243. package/src/lib/styles/styles.scss +0 -112
  244. package/src/lib/styles/variables.scss +0 -105
  245. package/src/lib/utils/.gitkeep +0 -0
  246. package/src/lib/utils/additional-languages/erlang.ts +0 -115
  247. package/src/lib/utils/resize-element.ts +0 -15
  248. package/src/lib/utils/time-to-ms.util.ts +0 -10
  249. package/src/test-setup.ts +0 -3
  250. package/tsconfig.json +0 -19
  251. package/tsconfig.lib.json +0 -19
  252. package/tsconfig.lib.prod.json +0 -10
  253. package/tsconfig.spec.json +0 -17
  254. /package/{src/assets → assets}/i18n/en.json +0 -0
  255. /package/{src/lib/components/code-editor/helpers/index.ts → lib/components/code-editor/helpers/index.d.ts} +0 -0
@@ -1,53 +0,0 @@
1
- import { TestBed } from '@angular/core/testing';
2
-
3
- import { TestCasesService } from './test-cases.service';
4
-
5
- describe('TestCasesService', () => {
6
- let service: TestCasesService;
7
-
8
- beforeEach(() => {
9
- TestBed.configureTestingModule({});
10
- service = TestBed.inject(TestCasesService);
11
- });
12
-
13
- describe('when setActiveTestCase is called', () => {
14
- it('should emit index to activeTestCaseIndex$', done => {
15
- service.setActiveTestCase(3);
16
-
17
- service.activeTestCaseIndex$.subscribe(index => {
18
- expect(index).toBe(3);
19
- done();
20
- });
21
- });
22
- });
23
-
24
- describe('when createTestCaseLocalId is called', () => {
25
- it('should increment lastTestCaseLocalId by 1 and return it', () => {
26
- service.createTestCaseLocalId();
27
- const result = service.createTestCaseLocalId();
28
-
29
- expect(result).toBe(2);
30
- });
31
- });
32
-
33
- describe('when resetLastTestCaseLocalId is called', () => {
34
- it('should reset lastTestCaseLocalId to 0', () => {
35
- service.createTestCaseLocalId();
36
- service.createTestCaseLocalId();
37
- service.createTestCaseLocalId();
38
-
39
- service.resetLastTestCaseLocalId();
40
-
41
- expect(service.createTestCaseLocalId()).toBe(1);
42
- });
43
- });
44
-
45
- describe('when updateTestCaseLocalId is called', () => {
46
- it('should update lastTestCaseLocalId to passed value', () => {
47
- const localId = 3;
48
- service.updateTestCaseLocalId(localId);
49
-
50
- expect(service.createTestCaseLocalId()).toBe(localId + 1);
51
- });
52
- });
53
- });
@@ -1,29 +0,0 @@
1
- import { Injectable } from '@angular/core';
2
- import { BehaviorSubject } from 'rxjs';
3
-
4
- @Injectable({
5
- providedIn: 'root',
6
- })
7
- export class TestCasesService {
8
- private lastTestCaseLocalId = 0;
9
-
10
- private activeTestCaseIndexSubj$ = new BehaviorSubject<number | null>(0);
11
- activeTestCaseIndex$ = this.activeTestCaseIndexSubj$.asObservable();
12
-
13
- setActiveTestCase(index: number | null): void {
14
- this.activeTestCaseIndexSubj$.next(index);
15
- }
16
-
17
- createTestCaseLocalId(): number {
18
- this.lastTestCaseLocalId += 1;
19
- return this.lastTestCaseLocalId;
20
- }
21
-
22
- updateTestCaseLocalId(value: number): void {
23
- this.lastTestCaseLocalId = value;
24
- }
25
-
26
- resetLastTestCaseLocalId(): void {
27
- this.lastTestCaseLocalId = 0;
28
- }
29
- }
@@ -1,76 +0,0 @@
1
- import { ThemeService } from './theme.service';
2
- import { LibCodingTestService } from './lib-coding-test.service';
3
- import { Themes } from '../models/theme';
4
- import { BehaviorSubject } from 'rxjs';
5
- import { TestBed } from '@angular/core/testing';
6
-
7
- describe('ThemeService', () => {
8
- let service: ThemeService;
9
- let libCodingTestServiceMock: Partial<LibCodingTestService>;
10
- let themeSubject: BehaviorSubject<Themes>;
11
-
12
- beforeEach(() => {
13
- themeSubject = new BehaviorSubject<Themes>(Themes.Default);
14
- libCodingTestServiceMock = {
15
- themeChanged$: themeSubject.asObservable(),
16
- };
17
- TestBed.configureTestingModule({
18
- providers: [ThemeService, { provide: LibCodingTestService, useValue: libCodingTestServiceMock }],
19
- });
20
- service = TestBed.inject(ThemeService);
21
- });
22
-
23
- describe('when theme is dark', () => {
24
- describe('AND rebranded company color', () => {
25
- it('should emit companyColor = PINK + themeSpecificColor = WHITE', done => {
26
- service.companyColor = '#D410AA';
27
- themeSubject.next(Themes.Dark);
28
-
29
- service.themeColors$.subscribe(({ companyColor, themeSpecificColor }) => {
30
- expect(companyColor).toBe('#D410AA');
31
- expect(themeSpecificColor).toBe('#FFFFFF');
32
- done();
33
- });
34
- });
35
- });
36
-
37
- describe('AND default company color', () => {
38
- it('should emit companyColor + themeSpecificColor = TEAL', done => {
39
- themeSubject.next(Themes.Dark);
40
-
41
- service.themeColors$.subscribe(({ companyColor, themeSpecificColor }) => {
42
- expect(companyColor).toBe('#46a997');
43
- expect(themeSpecificColor).toBe('#46a997');
44
- done();
45
- });
46
- });
47
- });
48
- });
49
-
50
- describe('when theme is light', () => {
51
- describe('AND rebranded company color', () => {
52
- it('should emit companyColor + themeSpecificColor = PINK', done => {
53
- service.companyColor = '#D410AA';
54
- themeSubject.next(Themes.Default);
55
-
56
- service.themeColors$.subscribe(({ companyColor, themeSpecificColor }) => {
57
- expect(companyColor).toBe('#D410AA');
58
- expect(themeSpecificColor).toBe('#D410AA');
59
- done();
60
- });
61
- });
62
- });
63
-
64
- describe('AND default company color', () => {
65
- it('should emit companyColor + themeSpecificColor = TEAL', done => {
66
- themeSubject.next(Themes.Default);
67
-
68
- service.themeColors$.subscribe(({ companyColor, themeSpecificColor }) => {
69
- expect(companyColor).toBe('#46a997');
70
- expect(themeSpecificColor).toBe('#46a997');
71
- done();
72
- });
73
- });
74
- });
75
- });
76
- });
@@ -1,34 +0,0 @@
1
- import { Injectable } from '@angular/core';
2
- import { LibCodingTestService } from './lib-coding-test.service';
3
- import { Themes } from '../models/theme';
4
- import { BehaviorSubject, combineLatest, map } from 'rxjs';
5
-
6
- @Injectable({
7
- providedIn: 'root',
8
- })
9
- export class ThemeService {
10
- private defaultCompanyColor = '#46a997';
11
- private companyColorSubject = new BehaviorSubject<string>(this.defaultCompanyColor);
12
- private themeSubject = new BehaviorSubject<Themes>(Themes.Default);
13
-
14
- themeColors$ = combineLatest([this.themeSubject, this.companyColorSubject]).pipe(
15
- map(([theme, companyColor]) => {
16
- const themeSpecificColor = this.getAdjustedColorForTheme(theme, companyColor);
17
- return { companyColor, themeSpecificColor };
18
- })
19
- );
20
-
21
- constructor(private libCodingService: LibCodingTestService) {
22
- this.libCodingService.themeChanged$.subscribe(theme => {
23
- this.themeSubject.next(theme);
24
- });
25
- }
26
-
27
- set companyColor(color: string) {
28
- this.companyColorSubject.next(color);
29
- }
30
-
31
- private getAdjustedColorForTheme(theme: Themes, color: string): string {
32
- return theme === Themes.Dark && color.toUpperCase() === '#D410AA' ? '#FFFFFF' : color;
33
- }
34
- }
@@ -1,86 +0,0 @@
1
- @mixin as-split-styles() {
2
- .as-split {
3
- min-height: 500px;
4
-
5
- ::ng-deep .as-split-gutter {
6
- position: relative;
7
- background-color: #D9D9D9 !important;
8
- transition: background 200ms ease-in-out;
9
-
10
- &-icon {
11
- background-image: none !important;
12
-
13
- position: absolute;
14
- border-radius: 5px;
15
- background: #D9D9D9;
16
- transition: background 200ms ease-in-out;
17
-
18
- &::before, &::after {
19
- content: "";
20
- position: absolute;
21
- }
22
- }
23
-
24
- &:hover, &.as-dragged {
25
- background-color: var(--company-color, #46A997) !important;
26
-
27
- .as-split-gutter-icon {
28
- background: var(--company-color, #46A997);
29
- }
30
- }
31
- }
32
-
33
- &.as-horizontal {
34
- ::ng-deep > .as-split-gutter {
35
- .as-split-gutter-icon {
36
- height: 34px !important;
37
- width: 12px !important;
38
- z-index: 1;
39
-
40
- &::before, &::after {
41
- top: 9px;
42
- bottom: 9px;
43
- background-color: var(--bg-mat-card);
44
- width: 2px;
45
- border-radius: 5px;
46
- }
47
-
48
- &::before {
49
- left: 2px;
50
- }
51
-
52
- &::after {
53
- right: 2px;
54
- }
55
- }
56
- }
57
- }
58
-
59
- &.as-vertical {
60
- ::ng-deep > .as-split-gutter {
61
- .as-split-gutter-icon {
62
- height: 12px !important;
63
- width: 34px !important;
64
-
65
- &::before, &::after {
66
- left: 9px;
67
- right: 9px;
68
- background-color: var(--bg-mat-card);
69
- height: 2px;
70
- width: auto;
71
- border-radius: 5px;
72
- }
73
-
74
- &::before {
75
- top: 2px;
76
- }
77
-
78
- &::after {
79
- top: auto;
80
- bottom: 2px;
81
- }
82
- }
83
- }
84
- }
85
- }
86
- }
@@ -1,112 +0,0 @@
1
- @import "@testgorilla/tgo-ui/projects/tgo-canopy-ui/theme/typography";
2
- @import "@testgorilla/tgo-ui/projects/tgo-canopy-ui/theme/input";
3
- @import "variables";
4
-
5
- lib-coding-test .theme-default {
6
- --page-bg: var(--color-accent-10);
7
- --bg-mat-card: #ffffff;
8
- --icon-bg-color: #323232;
9
- --icon-bg-hover-color: #f6f6f6;
10
- --icon-secondary-bg-color: #000000;
11
- --petrol-text-color: #276678;
12
- --status-bg-color: #f6f6f6;
13
- --button-bg-color: #ededed;
14
- --info-panel-color: #c8d7de;
15
- --code-editor-background: #fffffe;
16
- --select-chosen-text-color: #888888;
17
- --select-chosen-bg-color: #e9f0f1;
18
- --select-hovered-bg-color: rgba(0, 0, 0, 0.04);
19
- --select-options-text-color: #000000;
20
- --select-bg-color: #ffffff;
21
- --select-bg-color-light: #ffffff;
22
- --select-border-color: #eeeeee;
23
- --select-border-color-light: rgba(0, 0, 0, 0.12);
24
- --select-shadow-color: #cccccc;
25
- --select-arrow-color: rgba(0, 0, 0, 0.54);
26
- --drawer-bg-color: #ffffff;
27
- --toggle-thumb-bg-color: #ffffff;
28
- --toggle-body-bg-color: #ededed;
29
- --main-text-color: rgba(0, 0, 0, 0.87);
30
- --secondary-text-color: #000000;
31
- --status-empty-color: #888888;
32
- --border-bg-color: #e0e0e0;
33
- --teal-disabled-color: #B5DDD5;
34
- }
35
-
36
- lib-coding-test .theme-dark {
37
- --page-bg: #181818;
38
- --bg-mat-card: #2d2d2d;
39
- --icon-bg-color: #f6f6f6;
40
- --icon-bg-hover-color: #1e1e1e;
41
- --icon-secondary-bg-color: #f6f6f6;
42
- --petrol-text-color: #6894A0;
43
- --status-bg-color: #3c3c3c;
44
- --button-bg-color: #2d2d2d;
45
- --info-panel-color: #c8d7de;
46
- --code-editor-background: #1e1e1e;
47
- --select-chosen-text-color: #f6f6f6;
48
- --select-chosen-bg-color: #2d2d2d;
49
- --select-hovered-bg-color: rgba(45, 45, 45, 0.5);
50
- --select-options-text-color: #f6f6f6;
51
- --select-bg-color: #000000;
52
- --select-bg-color-light: #2D2D2D;
53
- --select-border-color: #2d2d2d;
54
- --select-border-color-light: #888888;
55
- --select-shadow-color: #2d2d2d;
56
- --select-arrow-color: #ffffff;
57
- --drawer-bg-color: #181818;
58
- --toggle-thumb-bg-color: #000000;
59
- --toggle-body-bg-color: #888888;
60
- --main-text-color: #ffffff;
61
- --secondary-text-color: #ffffff;
62
- --status-empty-color: #E0E0E0;
63
- --border-bg-color: #888888;
64
- --teal-disabled-color: #888888;
65
- --mdc-plain-tooltip-supporting-text-color: #000000;
66
-
67
- &.coding-question-fullscreen {
68
- --bg-mat-card: #181818;
69
- }
70
- }
71
-
72
- lib-coding-test {
73
- .themed-button {
74
- button:not(.tertiary) mat-icon svg {
75
- color: var(--icon-bg-color);
76
- fill: var(--icon-bg-color);
77
- }
78
-
79
- button.tertiary mat-icon svg {
80
- color: var(--company-color, #46A997);
81
- fill: var(--company-color, #46A997);
82
- }
83
-
84
- .button-wrapper {
85
- .icon-button:hover,
86
- .mdc-button:hover {
87
- // needed temporarily until mat-themes are defined in the main app, so ui-button colors can be defined globally
88
- background-color: var(--icon-bg-hover-color) !important;
89
- }
90
- }
91
- }
92
-
93
- // todo: remove when the ui-icon has these styles for mat-icon, not only svg
94
- mat-icon.size-24 {
95
- min-width: 24px;
96
- min-height: 24px;
97
- width: 24px;
98
- height: 24px;
99
- }
100
-
101
- mat-icon.size-16 {
102
- min-width: 16px;
103
- min-height: 16px;
104
- width: 16px;
105
- height: 16px;
106
- }
107
-
108
- ui-toggle.config-toggle mat-icon {
109
- width: auto;
110
- height: auto;
111
- }
112
- }
@@ -1,105 +0,0 @@
1
- /*
2
- * COLORS
3
- */
4
- :root {
5
- // Brand
6
- --color-primary-10: #FFF2FC;
7
- --color-primary-20: #FFE6FA;
8
- --color-primary-30: #FFB3EE;
9
- --color-primary-40: #FF54DA;
10
- --color-primary-50: #D410AA;
11
- --color-primary-60: #A90686;
12
-
13
- // Accent
14
- --color-accent-10: #FFFAF6;
15
- --color-accent-20: #FFF5ED;
16
-
17
- // Base
18
- --color-black: #242424;
19
- --color-black-opa-70: rgba(36, 36, 36, 0.70);
20
- --color-white: #FFFFFF;
21
-
22
- // Greyscale
23
- --color-grey-10: #F4F4F4;
24
- --color-grey-20: #E9E9E9;
25
- --color-grey-30: #D3D3D3;
26
- --color-grey-40: #919191;
27
- --color-grey-50: #666666;
28
-
29
- // Informative
30
- --color-info-10: #D9E8FF;
31
- --color-info-20: #99C1FE;
32
- --color-info-30: #277CFD;
33
- --color-info-40: #0165FC;
34
- --color-info-50: #1447AA;
35
-
36
- // Success
37
- --color-success-10: #F5FAE3;
38
- --color-success-20: #E2F4B3;
39
- --color-success-30: #C6E866;
40
- --color-success-40: #A0D90D;
41
- --color-success-50: #88B901;
42
-
43
- // Error
44
- --color-error-10: #FFEAE6;
45
- --color-error-20: #FFAC9A;
46
- --color-error-30: #FF6E4F;
47
- --color-error-40: #FF3003;
48
- --color-error-50: #E02800;
49
-
50
- // Warning
51
- --color-warning-10: #FFF5E6;
52
- --color-warning-20: #FFE1B3;
53
- --color-warning-30: #FFC268;
54
- --color-warning-40: #FF9A03;
55
- --color-warning-50: #D07D00;
56
- }
57
- /*
58
- * FONTS
59
- */
60
- :root {
61
- --font-family-main: "Modern Gothic", sans-serif;
62
- --font-h1: 900 40px/52px var(--font-family-main);
63
- --font-h2: 900 24px/30px var(--font-family-main);
64
- --font-h3: 700 20px/26px var(--font-family-main);
65
- --font-h4: 700 16px/20px var(--font-family-main);
66
- --font-h5: 700 14px/18px var(--font-family-main);
67
- --font-body-large: 400 16px/24px var(--font-family-main);
68
- --font-body-default: 400 14px/22px var(--font-family-main);
69
- --font-body-small: 400 12px/16px var(--font-family-main);
70
- --font-hyperlink-large: 500 16px/24px var(--font-family-main);
71
- --font-hyperlink-default: 500 14px/22px var(--font-family-main);
72
- --font-hyperlink-small: 500 12px/16px var(--font-family-main);
73
- --font-button-label: 500 14px/1.4 var(--font-family-main);
74
- --font-label: 400 14px/1.4 var(--font-family-main);
75
- }
76
- /*
77
- * BORDER RADIUS
78
- */
79
- :root {
80
- --border-radius-none: 0px;
81
- --border-radius-small: 4px;
82
- --border-radius-small-top: var(--border-radius-small) var(--border-radius-small) 0 0;
83
- --border-radius-small-bottom: 0 0 var(--border-radius-small) var(--border-radius-small);
84
- --border-radius-default: 10px;
85
- --border-radius-default-top: var(--border-radius-default) var(--border-radius-default) 0 0;
86
- --border-radius-default-bottom: 0 0 var(--border-radius-default) var(--border-radius-default);
87
- --border-radius-large: 36px;
88
- --border-radius-round: 50%;
89
- --color-grey-border: #DDDDDD;
90
- --color-grey-border-hover: #F6F6F6;
91
- }
92
- /*
93
- * BOX-SHADOWS
94
- */
95
- :root {
96
- --box-shadow-hover: 0px 4px 16px 0px rgba(36,36,36,0.08);
97
- --box-shadow-card: 0px 4px 100px 0px rgba(36,36,36,0.04);
98
- --box-shadow-notification: 0px 4px 16px 0px rgba(36,36,36,0.04);
99
- }
100
- /*
101
- * OTHERS
102
- */
103
- :root {
104
- --viewport-width: 1312px;
105
- }
File without changes
@@ -1,115 +0,0 @@
1
- export const erlangLanguage = {
2
- // Define default token
3
- defaultToken: '',
4
-
5
- // Define keywords
6
- keywords: [
7
- 'after',
8
- 'and',
9
- 'andalso',
10
- 'band',
11
- 'begin',
12
- 'bnot',
13
- 'bor',
14
- 'bsl',
15
- 'bsr',
16
- 'bxor',
17
- 'case',
18
- 'catch',
19
- 'cond',
20
- 'div',
21
- 'end',
22
- 'fun',
23
- 'if',
24
- 'let',
25
- 'not',
26
- 'of',
27
- 'or',
28
- 'orelse',
29
- 'query',
30
- 'receive',
31
- 'rem',
32
- 'try',
33
- 'when',
34
- 'xor',
35
- 'define',
36
- 'elif',
37
- 'else',
38
- 'endif',
39
- 'error',
40
- 'ifdef',
41
- 'ifndef',
42
- 'include',
43
- 'include_lib',
44
- 'undef',
45
- ],
46
-
47
- // Define type and function patterns
48
- typeKeywords: [
49
- 'atom',
50
- 'binary',
51
- 'bitstring',
52
- 'boolean',
53
- 'byte',
54
- 'char',
55
- 'float',
56
- 'integer',
57
- 'list',
58
- 'number',
59
- 'pid',
60
- 'port',
61
- 'reference',
62
- 'term',
63
- 'tuple',
64
- ],
65
-
66
- // Define operators
67
- operators: ['+', '-', '*', '/', '>', '<', '=', '==', '/=', '=:=', '=/=', '=<', '=>', '&&', '||', '!'],
68
-
69
- // Define symbols and delimiters
70
- symbols: /[=><!~?:&|+\-*/^%]+/,
71
-
72
- // The main tokenizer for Erlang
73
- tokenizer: {
74
- root: [
75
- // Identifiers and keywords
76
- [/[a-z][\w$]*/, { cases: { '@keywords': 'keyword', '@default': 'identifier' } }],
77
- [/[A-Z][\w$]*/, 'type.identifier'], // to handle the type and module names
78
-
79
- // Whitespace
80
- { include: '@whitespace' },
81
-
82
- // Delimiters and operators
83
- [/[{}()[\]\\]]/, '@brackets'],
84
- [/@symbols/, { cases: { '@operators': 'operator', '@default': '' } }],
85
-
86
- // Numbers
87
- [/\d+\.\d*([eE][-+]?\d+)?/, 'number.float'],
88
- [/\d+/, 'number'],
89
-
90
- // Strings
91
- [/"/, { token: 'string', bracket: '@open', next: '@string' }],
92
-
93
- // Atoms
94
- [/'([^'\\]|\\.)*$/, 'string.invalid'], // non-terminated atom
95
- [/'/, { token: 'string', bracket: '@open', next: '@atom' }],
96
- ],
97
-
98
- string: [
99
- [/[^\\"]+/, 'string'],
100
- [/\\./, 'string.escape'],
101
- [/"/, { token: 'string', bracket: '@close', next: '@pop' }],
102
- ],
103
-
104
- atom: [
105
- [/[^\\']+/, 'string'],
106
- [/\\./, 'string.escape'],
107
- [/'/, { token: 'string', bracket: '@close', next: '@pop' }],
108
- ],
109
-
110
- whitespace: [
111
- [/[ \t\r\n]+/, 'white'],
112
- [/%.*$/, 'comment'], // Single line comment
113
- ],
114
- },
115
- };
@@ -1,15 +0,0 @@
1
- import { Observable, Subscriber } from 'rxjs';
2
-
3
- export function resizeElement(element: Element): Observable<ResizeObserverEntry> {
4
- return new Observable((observer: Subscriber<ResizeObserverEntry>) => {
5
- const resizeObserver = new ResizeObserver(([entry]) => {
6
- observer.next(entry);
7
- });
8
-
9
- resizeObserver.observe(element);
10
-
11
- return () => {
12
- resizeObserver.disconnect();
13
- };
14
- });
15
- }
@@ -1,10 +0,0 @@
1
- export function timeToMs(time: number, type: 'days' | 'hours' = 'days'): number {
2
- switch (type) {
3
- case 'hours':
4
- return time * 60 * 60 * 1000;
5
- case 'days':
6
- return time * 24 * 60 * 60 * 1000;
7
- default:
8
- throw new Error('Invalid type. Use "hours" or "days".');
9
- }
10
- }
package/src/test-setup.ts DELETED
@@ -1,3 +0,0 @@
1
- import { setupZoneTestEnv } from 'jest-preset-angular/setup-env/zone';
2
-
3
- setupZoneTestEnv();
package/tsconfig.json DELETED
@@ -1,19 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "es2022",
4
- "paths": {
5
- "@testgorilla/tgo-test-shared": ["./src/shared/index.ts"]
6
- }
7
- },
8
- "files": [],
9
- "include": [],
10
- "references": [
11
- {
12
- "path": "./tsconfig.lib.json"
13
- },
14
- {
15
- "path": "./tsconfig.spec.json"
16
- }
17
- ],
18
- "extends": "../../tsconfig.base.json"
19
- }
package/tsconfig.lib.json DELETED
@@ -1,19 +0,0 @@
1
- {
2
- "extends": "./tsconfig.json",
3
- "compilerOptions": {
4
- "outDir": "../../dist/out-tsc",
5
- "declaration": true,
6
- "declarationMap": true,
7
- "inlineSources": true,
8
- "baseUrl": "../../",
9
- "moduleResolution": "node",
10
- "paths": {
11
- "@testgorilla/tgo-test-shared": ["packages/tgo-coding-test/src/shared/index.ts"]
12
- }
13
- },
14
- "angularCompilerOptions": {
15
- "preserveWhitespaces": false
16
- },
17
- "exclude": ["src/**/*.spec.ts", "src/test-setup.ts", "jest.config.ts", "src/**/*.test.ts"],
18
- "include": ["src/**/*.ts", "src/shared/**/*.ts"]
19
- }