@testgorilla/tgo-coding-test 1.0.0 → 2.0.0
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.
- package/.eslintrc.json +46 -0
- package/jest.config.ts +26 -0
- package/ng-package.json +14 -0
- package/package.json +15 -31
- package/project.json +48 -0
- package/{index.d.ts → src/index.ts} +19 -2
- package/src/lib/components/.gitkeep +0 -0
- package/src/lib/components/code-editor/code-editor.component.html +10 -0
- package/src/lib/components/code-editor/code-editor.component.scss +21 -0
- package/src/lib/components/code-editor/code-editor.component.spec.ts +136 -0
- package/src/lib/components/code-editor/code-editor.component.ts +368 -0
- package/src/lib/components/code-editor/code-editor.mocks.ts +28 -0
- package/src/lib/components/code-editor/code-editor.service.spec.ts +160 -0
- package/src/lib/components/code-editor/code-editor.service.ts +94 -0
- package/src/lib/components/code-editor/helpers/c-helper.spec.ts +39 -0
- package/src/lib/components/code-editor/helpers/c-helper.ts +51 -0
- package/src/lib/components/code-editor/helpers/code-editor-helper.base.spec.ts +30 -0
- package/src/lib/components/code-editor/helpers/code-editor-helper.base.ts +16 -0
- package/src/lib/components/code-editor/helpers/code-editor-helper.mocks.ts +24 -0
- package/src/lib/components/code-editor/helpers/code-editor-helper.model.ts +67 -0
- package/src/lib/components/code-editor/helpers/cpp-helper.spec.ts +40 -0
- package/src/lib/components/code-editor/helpers/cpp-helper.ts +52 -0
- package/src/lib/components/code-editor/helpers/csharp-helper.spec.ts +42 -0
- package/src/lib/components/code-editor/helpers/csharp-helper.ts +55 -0
- package/src/lib/components/code-editor/helpers/go-helper.spec.ts +41 -0
- package/src/lib/components/code-editor/helpers/go-helper.ts +54 -0
- package/src/lib/components/code-editor/helpers/java-helper.spec.ts +41 -0
- package/src/lib/components/code-editor/helpers/java-helper.ts +54 -0
- package/src/lib/components/code-editor/helpers/javascript-helper.spec.ts +39 -0
- package/src/lib/components/code-editor/helpers/javascript-helper.ts +32 -0
- package/src/lib/components/code-editor/helpers/kotlin-helper.spec.ts +41 -0
- package/src/lib/components/code-editor/helpers/kotlin-helper.ts +54 -0
- package/src/lib/components/code-editor/helpers/php-helper.spec.ts +39 -0
- package/src/lib/components/code-editor/helpers/php-helper.ts +32 -0
- package/src/lib/components/code-editor/helpers/python-helper.spec.ts +39 -0
- package/src/lib/components/code-editor/helpers/python-helper.ts +32 -0
- package/src/lib/components/code-editor/helpers/r-helper.spec.ts +39 -0
- package/src/lib/components/code-editor/helpers/r-helper.ts +32 -0
- package/src/lib/components/code-editor/helpers/ruby-helper.spec.ts +39 -0
- package/src/lib/components/code-editor/helpers/ruby-helper.ts +32 -0
- package/src/lib/components/code-editor/helpers/scala-helper.spec.ts +41 -0
- package/src/lib/components/code-editor/helpers/scala-helper.ts +53 -0
- package/src/lib/components/code-editor/helpers/sql-helper.spec.ts +87 -0
- package/src/lib/components/code-editor/helpers/sql-helper.ts +44 -0
- package/src/lib/components/code-editor/helpers/swift-helper.spec.ts +40 -0
- package/src/lib/components/code-editor/helpers/swift-helper.ts +51 -0
- package/src/lib/components/code-editor/helpers/typescript-helper.spec.ts +40 -0
- package/src/lib/components/code-editor/helpers/typescript-helper.ts +52 -0
- package/src/lib/components/code-editor/models/code-editor.model.ts +9 -0
- package/src/lib/components/code-editor/models/coding-snapshot.model.ts +4 -0
- package/src/lib/components/coding-question/coding-question.component.html +78 -0
- package/src/lib/components/coding-question/coding-question.component.scss +75 -0
- package/src/lib/components/coding-question/coding-question.component.spec.ts +85 -0
- package/src/lib/components/coding-question/coding-question.component.ts +101 -0
- package/src/lib/components/coding-section/coding-section.component.html +82 -0
- package/src/lib/components/coding-section/coding-section.component.scss +64 -0
- package/src/lib/components/coding-section/coding-section.component.spec.ts +257 -0
- package/src/lib/components/coding-section/coding-section.component.ts +186 -0
- package/src/lib/components/coding-test.module.ts +124 -0
- package/src/lib/components/common/truncated-text/truncated-text.component.html +6 -0
- package/src/lib/components/common/truncated-text/truncated-text.component.scss +18 -0
- package/src/lib/components/common/truncated-text/truncated-text.component.spec.ts +84 -0
- package/src/lib/components/common/truncated-text/truncated-text.component.ts +36 -0
- package/src/lib/components/configurations/configurations.component.html +57 -0
- package/src/lib/components/configurations/configurations.component.scss +42 -0
- package/src/lib/components/configurations/configurations.component.spec.ts +186 -0
- package/src/lib/components/configurations/configurations.component.ts +97 -0
- package/src/lib/components/instructions/instructions.component.html +41 -0
- package/src/lib/components/instructions/instructions.component.scss +173 -0
- package/src/lib/components/instructions/instructions.component.spec.ts +106 -0
- package/src/lib/components/instructions/instructions.component.ts +137 -0
- package/src/lib/components/panel/panel.component.html +19 -0
- package/src/lib/components/panel/panel.component.scss +41 -0
- package/src/lib/components/panel/panel.component.spec.ts +40 -0
- package/src/lib/components/panel/panel.component.ts +33 -0
- package/src/lib/components/runnable-editor/runnable-editor.component.html +75 -0
- package/src/lib/components/runnable-editor/runnable-editor.component.scss +55 -0
- package/src/lib/components/runnable-editor/runnable-editor.component.spec.ts +124 -0
- package/src/lib/components/runnable-editor/runnable-editor.component.ts +154 -0
- package/src/lib/components/tests/test-cases/test-cases.component.html +135 -0
- package/src/lib/components/tests/test-cases/test-cases.component.scss +220 -0
- package/src/lib/components/tests/test-cases/test-cases.component.spec.ts +401 -0
- package/src/lib/components/tests/test-cases/test-cases.component.ts +204 -0
- package/src/lib/components/tests/test-cases-content/test-cases-content.component.html +94 -0
- package/src/lib/components/tests/test-cases-content/test-cases-content.component.scss +103 -0
- package/src/lib/components/tests/test-cases-content/test-cases-content.component.spec.ts +122 -0
- package/src/lib/components/tests/test-cases-content/test-cases-content.component.ts +101 -0
- package/src/lib/components/tests/test-cases-status/test-cases-status.component.html +16 -0
- package/src/lib/components/tests/test-cases-status/test-cases-status.component.scss +49 -0
- package/src/lib/components/tests/test-cases-status/test-cases-status.component.spec.ts +22 -0
- package/src/lib/components/tests/test-cases-status/test-cases-status.component.ts +17 -0
- package/src/lib/components/tests/test-results.component.html +119 -0
- package/src/lib/components/tests/test-results.component.scss +189 -0
- package/src/lib/components/tests/test-results.component.spec.ts +140 -0
- package/src/lib/components/tests/test-results.component.ts +97 -0
- package/src/lib/components/tgo-coding-test/tgo-coding-test.component.html +96 -0
- package/src/lib/components/tgo-coding-test/tgo-coding-test.component.scss +6 -0
- package/src/lib/components/tgo-coding-test/tgo-coding-test.component.spec.ts +599 -0
- package/src/lib/components/tgo-coding-test/tgo-coding-test.component.ts +278 -0
- package/src/lib/components/tgo-coding-test-candidate-view/tgo-coding-test-candidate-view.component.html +36 -0
- package/src/lib/components/tgo-coding-test-candidate-view/tgo-coding-test-candidate-view.component.scss +183 -0
- package/src/lib/components/tgo-coding-test-candidate-view/tgo-coding-test-candidate-view.component.spec.ts +883 -0
- package/src/lib/components/tgo-coding-test-candidate-view/tgo-coding-test-candidate-view.component.ts +578 -0
- package/{lib/config/index.d.ts → src/lib/config/index.ts} +1 -0
- package/src/lib/config/tgo-coding-test.config.ts +26 -0
- package/{lib/config/tgo-coding-test.provider.d.ts → src/lib/config/tgo-coding-test.provider.ts} +18 -6
- package/src/lib/config/tgo-coding-test.token.ts +21 -0
- package/src/lib/models/.gitkeep +0 -0
- package/src/lib/models/auto-saved-data.ts +51 -0
- package/src/lib/models/code-event.ts +17 -0
- package/src/lib/models/coderunner-execution-results.ts +58 -0
- package/src/lib/models/coding-lib.mocks.ts +246 -0
- package/src/lib/models/configs.ts +18 -0
- package/src/lib/models/language-change-action.ts +4 -0
- package/src/lib/models/lat-languages.ts +12 -0
- package/src/lib/models/mixpanel-events.ts +3 -0
- package/src/lib/models/mode.ts +5 -0
- package/src/lib/models/paste-data.ts +4 -0
- package/src/lib/models/programming-language.ts +9 -0
- package/src/lib/models/test-cases.ts +74 -0
- package/src/lib/models/theme.ts +5 -0
- package/src/lib/models/translations.ts +1 -0
- package/src/lib/models/view-mode.ts +6 -0
- package/{lib/pipes/memoize-func.pipe.d.ts → src/lib/pipes/memoize-func.pipe.ts} +14 -6
- package/src/lib/services/.gitkeep +0 -0
- package/src/lib/services/candidate-coding-test-services/candidature-api.service.spec.ts +40 -0
- package/src/lib/services/candidate-coding-test-services/candidature-api.service.ts +15 -0
- package/src/lib/services/candidate-coding-test-services/coderunner-api.service.spec.ts +134 -0
- package/src/lib/services/candidate-coding-test-services/coderunner-api.service.ts +105 -0
- package/src/lib/services/candidate-coding-test-services/coding-test-tour.service.spec.ts +161 -0
- package/src/lib/services/candidate-coding-test-services/coding-test-tour.service.ts +100 -0
- package/src/lib/services/candidate-coding-test-services/coding-test.service.spec.ts +1524 -0
- package/src/lib/services/candidate-coding-test-services/coding-test.service.ts +843 -0
- package/{lib/services/candidate-coding-test-services/index.d.ts → src/lib/services/candidate-coding-test-services/index.ts} +1 -1
- package/src/lib/services/coding-test-config.service.ts +48 -0
- package/src/lib/services/configurations.service.mocks.ts +77 -0
- package/src/lib/services/configurations.service.spec.ts +79 -0
- package/src/lib/services/configurations.service.ts +111 -0
- package/src/lib/services/index.ts +0 -0
- package/src/lib/services/lib-coding-test.service.spec.ts +265 -0
- package/src/lib/services/lib-coding-test.service.ts +157 -0
- package/src/lib/services/local-storage.service.mocks.ts +22 -0
- package/src/lib/services/storage.service.spec.ts +1119 -0
- package/src/lib/services/storage.service.ts +729 -0
- package/src/lib/services/test-cases.service.spec.ts +53 -0
- package/src/lib/services/test-cases.service.ts +29 -0
- package/src/lib/services/theme.service.spec.ts +76 -0
- package/src/lib/services/theme.service.ts +34 -0
- package/src/lib/styles/mixins.scss +86 -0
- package/src/lib/styles/styles.scss +112 -0
- package/src/lib/styles/variables.scss +105 -0
- package/src/lib/utils/.gitkeep +0 -0
- package/src/lib/utils/additional-languages/erlang.ts +115 -0
- package/src/lib/utils/resize-element.ts +15 -0
- package/src/lib/utils/time-to-ms.util.ts +10 -0
- package/src/test-setup.ts +3 -0
- package/tsconfig.json +19 -0
- package/tsconfig.lib.json +19 -0
- package/tsconfig.lib.prod.json +10 -0
- package/tsconfig.spec.json +17 -0
- package/esm2022/index.mjs +0 -12
- package/esm2022/lib/components/code-editor/code-editor.component.mjs +0 -335
- package/esm2022/lib/components/code-editor/code-editor.service.mjs +0 -72
- package/esm2022/lib/components/code-editor/helpers/c-helper.mjs +0 -40
- package/esm2022/lib/components/code-editor/helpers/code-editor-helper.base.mjs +0 -11
- package/esm2022/lib/components/code-editor/helpers/code-editor-helper.model.mjs +0 -2
- package/esm2022/lib/components/code-editor/helpers/cpp-helper.mjs +0 -41
- package/esm2022/lib/components/code-editor/helpers/csharp-helper.mjs +0 -42
- package/esm2022/lib/components/code-editor/helpers/go-helper.mjs +0 -42
- package/esm2022/lib/components/code-editor/helpers/index.mjs +0 -16
- package/esm2022/lib/components/code-editor/helpers/java-helper.mjs +0 -42
- package/esm2022/lib/components/code-editor/helpers/javascript-helper.mjs +0 -26
- package/esm2022/lib/components/code-editor/helpers/kotlin-helper.mjs +0 -42
- package/esm2022/lib/components/code-editor/helpers/php-helper.mjs +0 -26
- package/esm2022/lib/components/code-editor/helpers/python-helper.mjs +0 -26
- package/esm2022/lib/components/code-editor/helpers/r-helper.mjs +0 -26
- package/esm2022/lib/components/code-editor/helpers/ruby-helper.mjs +0 -26
- package/esm2022/lib/components/code-editor/helpers/scala-helper.mjs +0 -41
- package/esm2022/lib/components/code-editor/helpers/sql-helper.mjs +0 -34
- package/esm2022/lib/components/code-editor/helpers/swift-helper.mjs +0 -40
- package/esm2022/lib/components/code-editor/helpers/typescript-helper.mjs +0 -41
- package/esm2022/lib/components/code-editor/models/code-editor.model.mjs +0 -2
- package/esm2022/lib/components/code-editor/models/coding-snapshot.model.mjs +0 -2
- package/esm2022/lib/components/coding-question/coding-question.component.mjs +0 -126
- package/esm2022/lib/components/coding-section/coding-section.component.mjs +0 -188
- package/esm2022/lib/components/common/truncated-text/truncated-text.component.mjs +0 -38
- package/esm2022/lib/components/configurations/configurations.component.mjs +0 -97
- package/esm2022/lib/components/instructions/instructions.component.mjs +0 -139
- package/esm2022/lib/components/panel/panel.component.mjs +0 -34
- package/esm2022/lib/components/runnable-editor/runnable-editor.component.mjs +0 -169
- package/esm2022/lib/components/tests/test-cases/test-cases.component.mjs +0 -198
- package/esm2022/lib/components/tests/test-cases-content/test-cases-content.component.mjs +0 -96
- package/esm2022/lib/components/tests/test-cases-status/test-cases-status.component.mjs +0 -21
- package/esm2022/lib/components/tests/test-results.component.mjs +0 -127
- package/esm2022/lib/components/tgo-coding-test/tgo-coding-test.component.mjs +0 -280
- package/esm2022/lib/components/tgo-coding-test-candidate-view/tgo-coding-test-candidate-view.component.mjs +0 -476
- package/esm2022/lib/config/index.mjs +0 -2
- package/esm2022/lib/config/tgo-coding-test.config.mjs +0 -2
- package/esm2022/lib/config/tgo-coding-test.provider.mjs +0 -34
- package/esm2022/lib/config/tgo-coding-test.token.mjs +0 -14
- package/esm2022/lib/models/auto-saved-data.mjs +0 -2
- package/esm2022/lib/models/code-event.mjs +0 -2
- package/esm2022/lib/models/coderunner-execution-results.mjs +0 -2
- package/esm2022/lib/models/configs.mjs +0 -2
- package/esm2022/lib/models/language-change-action.mjs +0 -2
- package/esm2022/lib/models/lat-languages.mjs +0 -3
- package/esm2022/lib/models/mixpanel-events.mjs +0 -2
- package/esm2022/lib/models/mode.mjs +0 -2
- package/esm2022/lib/models/paste-data.mjs +0 -2
- package/esm2022/lib/models/programming-language.mjs +0 -2
- package/esm2022/lib/models/test-cases.mjs +0 -7
- package/esm2022/lib/models/theme.mjs +0 -2
- package/esm2022/lib/models/translations.mjs +0 -2
- package/esm2022/lib/models/view-mode.mjs +0 -8
- package/esm2022/lib/pipes/memoize-func.pipe.mjs +0 -39
- package/esm2022/lib/services/candidate-coding-test-services/candidature-api.service.mjs +0 -19
- package/esm2022/lib/services/candidate-coding-test-services/coderunner-api.service.mjs +0 -58
- package/esm2022/lib/services/candidate-coding-test-services/coding-test-tour.service.mjs +0 -89
- package/esm2022/lib/services/candidate-coding-test-services/coding-test.service.mjs +0 -490
- package/esm2022/lib/services/candidate-coding-test-services/index.mjs +0 -5
- package/esm2022/lib/services/coding-test-config.service.mjs +0 -51
- package/esm2022/lib/services/configurations.service.mjs +0 -89
- package/esm2022/lib/services/lib-coding-test.service.mjs +0 -106
- package/esm2022/lib/services/storage.service.mjs +0 -624
- package/esm2022/lib/services/test-cases.service.mjs +0 -30
- package/esm2022/lib/services/theme.service.mjs +0 -36
- package/esm2022/lib/utils/additional-languages/erlang.mjs +0 -103
- package/esm2022/lib/utils/resize-element.mjs +0 -13
- package/esm2022/lib/utils/time-to-ms.util.mjs +0 -11
- package/esm2022/shared/index.mjs +0 -5
- package/esm2022/shared/lib/components/audio-animation/audio-animation.component.mjs +0 -114
- package/esm2022/shared/lib/components/audio-animation/index.mjs +0 -2
- package/esm2022/shared/lib/components/index.mjs +0 -3
- package/esm2022/shared/lib/components/vimeo-video/index.mjs +0 -2
- package/esm2022/shared/lib/components/vimeo-video/vimeo-video.component.mjs +0 -101
- package/esm2022/shared/lib/models/answer.mjs +0 -2
- package/esm2022/shared/lib/models/assessment.mjs +0 -2
- package/esm2022/shared/lib/models/environment.mjs +0 -2
- package/esm2022/shared/lib/models/index.mjs +0 -9
- package/esm2022/shared/lib/models/question-component.mjs +0 -2
- package/esm2022/shared/lib/models/question.mjs +0 -2
- package/esm2022/shared/lib/models/test.mjs +0 -2
- package/esm2022/shared/lib/models/translations.mjs +0 -2
- package/esm2022/shared/lib/models/window.mjs +0 -2
- package/esm2022/shared/lib/services/api/api.service.mjs +0 -97
- package/esm2022/shared/lib/services/api/mocked-api.service.mjs +0 -131
- package/esm2022/shared/lib/services/environment/environment.service.mjs +0 -13
- package/esm2022/shared/lib/services/index.mjs +0 -10
- package/esm2022/shared/lib/services/localization/languages.model.mjs +0 -19
- package/esm2022/shared/lib/services/localization/transloco-lazy-module-utils.mjs +0 -27
- package/esm2022/shared/lib/services/localization/transloco-testing.module.mjs +0 -11
- package/esm2022/shared/lib/services/media/media.service.mjs +0 -129
- package/esm2022/shared/lib/services/mixpanel/mixpanel.service.mjs +0 -30
- package/esm2022/shared/lib/services/theme/theme.service.mjs +0 -24
- package/esm2022/shared/test-mocks/assessment-test.mock.mjs +0 -112
- package/esm2022/shared/test-mocks/index.mjs +0 -3
- package/esm2022/shared/test-mocks/tgo-ui.mock.mjs +0 -39
- package/esm2022/testgorilla-tgo-coding-test.mjs +0 -5
- package/fesm2022/testgorilla-tgo-coding-test.mjs +0 -4526
- package/fesm2022/testgorilla-tgo-coding-test.mjs.map +0 -1
- package/lib/components/code-editor/code-editor.component.d.ts +0 -54
- package/lib/components/code-editor/code-editor.service.d.ts +0 -12
- package/lib/components/code-editor/helpers/c-helper.d.ts +0 -11
- package/lib/components/code-editor/helpers/code-editor-helper.base.d.ts +0 -8
- package/lib/components/code-editor/helpers/code-editor-helper.model.d.ts +0 -62
- package/lib/components/code-editor/helpers/cpp-helper.d.ts +0 -11
- package/lib/components/code-editor/helpers/csharp-helper.d.ts +0 -12
- package/lib/components/code-editor/helpers/go-helper.d.ts +0 -12
- package/lib/components/code-editor/helpers/java-helper.d.ts +0 -12
- package/lib/components/code-editor/helpers/javascript-helper.d.ts +0 -10
- package/lib/components/code-editor/helpers/kotlin-helper.d.ts +0 -12
- package/lib/components/code-editor/helpers/php-helper.d.ts +0 -10
- package/lib/components/code-editor/helpers/python-helper.d.ts +0 -10
- package/lib/components/code-editor/helpers/r-helper.d.ts +0 -10
- package/lib/components/code-editor/helpers/ruby-helper.d.ts +0 -10
- package/lib/components/code-editor/helpers/scala-helper.d.ts +0 -12
- package/lib/components/code-editor/helpers/sql-helper.d.ts +0 -10
- package/lib/components/code-editor/helpers/swift-helper.d.ts +0 -11
- package/lib/components/code-editor/helpers/typescript-helper.d.ts +0 -11
- package/lib/components/code-editor/models/code-editor.model.d.ts +0 -8
- package/lib/components/code-editor/models/coding-snapshot.model.d.ts +0 -4
- package/lib/components/coding-question/coding-question.component.d.ts +0 -45
- package/lib/components/coding-section/coding-section.component.d.ts +0 -52
- package/lib/components/common/truncated-text/truncated-text.component.d.ts +0 -13
- package/lib/components/configurations/configurations.component.d.ts +0 -40
- package/lib/components/instructions/instructions.component.d.ts +0 -48
- package/lib/components/panel/panel.component.d.ts +0 -12
- package/lib/components/runnable-editor/runnable-editor.component.d.ts +0 -53
- package/lib/components/tests/test-cases/test-cases.component.d.ts +0 -46
- package/lib/components/tests/test-cases-content/test-cases-content.component.d.ts +0 -26
- package/lib/components/tests/test-cases-status/test-cases-status.component.d.ts +0 -9
- package/lib/components/tests/test-results.component.d.ts +0 -33
- package/lib/components/tgo-coding-test/tgo-coding-test.component.d.ts +0 -69
- package/lib/components/tgo-coding-test-candidate-view/tgo-coding-test-candidate-view.component.d.ts +0 -101
- package/lib/config/tgo-coding-test.config.d.ts +0 -24
- package/lib/config/tgo-coding-test.token.d.ts +0 -9
- package/lib/models/auto-saved-data.d.ts +0 -42
- package/lib/models/code-event.d.ts +0 -15
- package/lib/models/coderunner-execution-results.d.ts +0 -51
- package/lib/models/configs.d.ts +0 -15
- package/lib/models/language-change-action.d.ts +0 -4
- package/lib/models/lat-languages.d.ts +0 -8
- package/lib/models/mixpanel-events.d.ts +0 -3
- package/lib/models/mode.d.ts +0 -5
- package/lib/models/paste-data.d.ts +0 -4
- package/lib/models/programming-language.d.ts +0 -8
- package/lib/models/test-cases.d.ts +0 -67
- package/lib/models/theme.d.ts +0 -4
- package/lib/models/translations.d.ts +0 -1
- package/lib/models/view-mode.d.ts +0 -6
- package/lib/services/candidate-coding-test-services/candidature-api.service.d.ts +0 -10
- package/lib/services/candidate-coding-test-services/coderunner-api.service.d.ts +0 -18
- package/lib/services/candidate-coding-test-services/coding-test-tour.service.d.ts +0 -22
- package/lib/services/candidate-coding-test-services/coding-test.service.d.ts +0 -68
- package/lib/services/coding-test-config.service.d.ts +0 -38
- package/lib/services/configurations.service.d.ts +0 -37
- package/lib/services/lib-coding-test.service.d.ts +0 -69
- package/lib/services/storage.service.d.ts +0 -83
- package/lib/services/test-cases.service.d.ts +0 -12
- package/lib/services/theme.service.d.ts +0 -17
- package/lib/utils/additional-languages/erlang.d.ts +0 -37
- package/lib/utils/resize-element.d.ts +0 -2
- package/lib/utils/time-to-ms.util.d.ts +0 -1
- package/shared/index.d.ts +0 -4
- package/shared/lib/components/audio-animation/audio-animation.component.d.ts +0 -27
- package/shared/lib/components/audio-animation/index.d.ts +0 -1
- package/shared/lib/components/index.d.ts +0 -2
- package/shared/lib/components/vimeo-video/index.d.ts +0 -1
- package/shared/lib/components/vimeo-video/vimeo-video.component.d.ts +0 -24
- package/shared/lib/models/answer.d.ts +0 -17
- package/shared/lib/models/assessment.d.ts +0 -80
- package/shared/lib/models/environment.d.ts +0 -1
- package/shared/lib/models/index.d.ts +0 -8
- package/shared/lib/models/question-component.d.ts +0 -54
- package/shared/lib/models/question.d.ts +0 -102
- package/shared/lib/models/test.d.ts +0 -81
- package/shared/lib/models/translations.d.ts +0 -1
- package/shared/lib/models/window.d.ts +0 -6
- package/shared/lib/services/api/api.service.d.ts +0 -25
- package/shared/lib/services/api/mocked-api.service.d.ts +0 -35
- package/shared/lib/services/environment/environment.service.d.ts +0 -6
- package/shared/lib/services/index.d.ts +0 -9
- package/shared/lib/services/localization/languages.model.d.ts +0 -15
- package/shared/lib/services/localization/transloco-lazy-module-utils.d.ts +0 -11
- package/shared/lib/services/localization/transloco-testing.module.d.ts +0 -2
- package/shared/lib/services/media/media.service.d.ts +0 -29
- package/shared/lib/services/mixpanel/mixpanel.service.d.ts +0 -10
- package/shared/lib/services/theme/theme.service.d.ts +0 -8
- package/shared/test-mocks/assessment-test.mock.d.ts +0 -21
- package/shared/test-mocks/index.d.ts +0 -2
- package/shared/test-mocks/tgo-ui.mock.d.ts +0 -21
- /package/{assets → src/assets}/i18n/en.json +0 -0
- /package/{lib/components/code-editor/helpers/index.d.ts → src/lib/components/code-editor/helpers/index.ts} +0 -0
package/.eslintrc.json
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": ["../../.eslintrc.json"],
|
|
3
|
+
"ignorePatterns": ["!**/*"],
|
|
4
|
+
"overrides": [
|
|
5
|
+
{
|
|
6
|
+
"files": ["*.ts"],
|
|
7
|
+
"extends": ["plugin:@nx/angular", "plugin:@angular-eslint/template/process-inline-templates"],
|
|
8
|
+
"rules": {
|
|
9
|
+
"@angular-eslint/directive-selector": [
|
|
10
|
+
"error",
|
|
11
|
+
{
|
|
12
|
+
"type": "attribute",
|
|
13
|
+
"prefix": "tgo",
|
|
14
|
+
"style": "camelCase"
|
|
15
|
+
}
|
|
16
|
+
],
|
|
17
|
+
"@angular-eslint/component-selector": [
|
|
18
|
+
"error",
|
|
19
|
+
{
|
|
20
|
+
"type": "element",
|
|
21
|
+
"prefix": "tgo",
|
|
22
|
+
"style": "kebab-case"
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
"@angular-eslint/prefer-standalone": "off"
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"files": ["*.html"],
|
|
30
|
+
"extends": ["plugin:@nx/angular-template"],
|
|
31
|
+
"rules": {}
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"files": ["*.json"],
|
|
35
|
+
"parser": "jsonc-eslint-parser",
|
|
36
|
+
"rules": {
|
|
37
|
+
"@nx/dependency-checks": [
|
|
38
|
+
"error",
|
|
39
|
+
{
|
|
40
|
+
"ignoredFiles": ["{projectRoot}/eslint.config.{js,cjs,mjs}"]
|
|
41
|
+
}
|
|
42
|
+
]
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
]
|
|
46
|
+
}
|
package/jest.config.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
displayName: 'tgo-coding-test',
|
|
3
|
+
preset: '../../jest.preset.js',
|
|
4
|
+
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
|
|
5
|
+
coverageDirectory: '../../coverage/packages/tgo-coding-test',
|
|
6
|
+
transform: {
|
|
7
|
+
'^.+\\.(ts|mjs|js|html)$': [
|
|
8
|
+
'jest-preset-angular',
|
|
9
|
+
{
|
|
10
|
+
tsconfig: '<rootDir>/tsconfig.spec.json',
|
|
11
|
+
stringifyContentPathRegex: '\\.(html|svg)$',
|
|
12
|
+
},
|
|
13
|
+
],
|
|
14
|
+
},
|
|
15
|
+
moduleNameMapper: {
|
|
16
|
+
'^@testgorilla/tgo-test-shared$': '<rootDir>/src/shared/index.ts',
|
|
17
|
+
},
|
|
18
|
+
transformIgnorePatterns: [
|
|
19
|
+
'node_modules/(?!.*\\.mjs$|lodash-es|@testgorilla/tgo-ui|ng2-charts|quill|ngx-quill|parchment)',
|
|
20
|
+
],
|
|
21
|
+
snapshotSerializers: [
|
|
22
|
+
'jest-preset-angular/build/serializers/no-ng-attributes',
|
|
23
|
+
'jest-preset-angular/build/serializers/ng-snapshot',
|
|
24
|
+
'jest-preset-angular/build/serializers/html-comment',
|
|
25
|
+
],
|
|
26
|
+
};
|
package/ng-package.json
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
|
|
3
|
+
"dest": "../../dist/packages/tgo-coding-test",
|
|
4
|
+
"assets": [
|
|
5
|
+
{
|
|
6
|
+
"glob": "**/*",
|
|
7
|
+
"input": "./src/assets",
|
|
8
|
+
"output": "./assets"
|
|
9
|
+
}
|
|
10
|
+
],
|
|
11
|
+
"lib": {
|
|
12
|
+
"entryFile": "src/index.ts"
|
|
13
|
+
}
|
|
14
|
+
}
|
package/package.json
CHANGED
|
@@ -1,44 +1,28 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@testgorilla/tgo-coding-test",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"peerDependencies": {
|
|
5
|
-
"@angular/animations": "^
|
|
6
|
-
"@angular/common": "^
|
|
7
|
-
"@angular/core": "^
|
|
8
|
-
"@angular/forms": "^
|
|
9
|
-
"@angular/material": "
|
|
10
|
-
"@angular/router": "^
|
|
5
|
+
"@angular/animations": "^19.2.17",
|
|
6
|
+
"@angular/common": "^19.2.17",
|
|
7
|
+
"@angular/core": "^19.2.17",
|
|
8
|
+
"@angular/forms": "^19.2.17",
|
|
9
|
+
"@angular/material": "19.2.19",
|
|
10
|
+
"@angular/router": "^19.2.17",
|
|
11
11
|
"@ngneat/transloco": "~4.3.0",
|
|
12
12
|
"@ngneat/until-destroy": "10.0.0",
|
|
13
|
-
"@testgorilla/tgo-ui": "^
|
|
14
|
-
"angular-split": "^
|
|
15
|
-
"jest-preset-angular": "
|
|
16
|
-
"monaco-editor": "0.
|
|
13
|
+
"@testgorilla/tgo-ui": "^4.0.0",
|
|
14
|
+
"angular-split": "^19.0.0",
|
|
15
|
+
"jest-preset-angular": "14.4.2",
|
|
16
|
+
"monaco-editor": "0.52.2",
|
|
17
17
|
"ngx-guided-tour": "^2.0.1",
|
|
18
|
-
"ngx-monaco-editor-v2": "^
|
|
19
|
-
"ngx-quill": "^
|
|
20
|
-
"ngx-webstorage": "^
|
|
18
|
+
"ngx-monaco-editor-v2": "^19.0.2",
|
|
19
|
+
"ngx-quill": "^27.1.2",
|
|
20
|
+
"ngx-webstorage": "^19.0.1",
|
|
21
21
|
"quill": "^2.0.3",
|
|
22
22
|
"rxjs": "~7.8.1"
|
|
23
23
|
},
|
|
24
24
|
"sideEffects": false,
|
|
25
25
|
"license": "PROPRIETARY",
|
|
26
26
|
"displayName": "Coding test",
|
|
27
|
-
"description": "Coding test component"
|
|
28
|
-
"module": "fesm2022/testgorilla-tgo-coding-test.mjs",
|
|
29
|
-
"typings": "index.d.ts",
|
|
30
|
-
"exports": {
|
|
31
|
-
"./package.json": {
|
|
32
|
-
"default": "./package.json"
|
|
33
|
-
},
|
|
34
|
-
".": {
|
|
35
|
-
"types": "./index.d.ts",
|
|
36
|
-
"esm2022": "./esm2022/testgorilla-tgo-coding-test.mjs",
|
|
37
|
-
"esm": "./esm2022/testgorilla-tgo-coding-test.mjs",
|
|
38
|
-
"default": "./fesm2022/testgorilla-tgo-coding-test.mjs"
|
|
39
|
-
}
|
|
40
|
-
},
|
|
41
|
-
"dependencies": {
|
|
42
|
-
"tslib": "^2.3.0"
|
|
43
|
-
}
|
|
27
|
+
"description": "Coding test component"
|
|
44
28
|
}
|
package/project.json
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "tgo-coding-test",
|
|
3
|
+
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
|
4
|
+
"sourceRoot": "packages/tgo-coding-test/src",
|
|
5
|
+
"prefix": "tgo",
|
|
6
|
+
"projectType": "library",
|
|
7
|
+
"tags": [],
|
|
8
|
+
"targets": {
|
|
9
|
+
"build": {
|
|
10
|
+
"executor": "nx:run-commands",
|
|
11
|
+
"outputs": ["{workspaceRoot}/dist/packages/tgo-coding-test"],
|
|
12
|
+
"options": {
|
|
13
|
+
"commands": [
|
|
14
|
+
"nx run tgo-coding-test:package",
|
|
15
|
+
"node scripts/replace-shared-alias.js dist/packages/tgo-coding-test @testgorilla/tgo-test-shared"
|
|
16
|
+
],
|
|
17
|
+
"parallel": false,
|
|
18
|
+
"forwardAllArgs": false
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"package": {
|
|
22
|
+
"executor": "@nx/angular:package",
|
|
23
|
+
"outputs": ["{workspaceRoot}/dist/{projectRoot}"],
|
|
24
|
+
"options": {
|
|
25
|
+
"project": "packages/tgo-coding-test/ng-package.json"
|
|
26
|
+
},
|
|
27
|
+
"configurations": {
|
|
28
|
+
"production": {
|
|
29
|
+
"tsConfig": "packages/tgo-coding-test/tsconfig.lib.prod.json"
|
|
30
|
+
},
|
|
31
|
+
"development": {
|
|
32
|
+
"tsConfig": "packages/tgo-coding-test/tsconfig.lib.json"
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"defaultConfiguration": "production"
|
|
36
|
+
},
|
|
37
|
+
"test": {
|
|
38
|
+
"executor": "@nx/jest:jest",
|
|
39
|
+
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
|
|
40
|
+
"options": {
|
|
41
|
+
"jestConfig": "packages/tgo-coding-test/jest.config.ts"
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"lint": {
|
|
45
|
+
"executor": "@nx/eslint:lint"
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -1,7 +1,19 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Public API Surface of coding-test
|
|
3
|
+
*/
|
|
4
|
+
|
|
1
5
|
export { TgoCodingTestComponent } from './lib/components/tgo-coding-test/tgo-coding-test.component';
|
|
2
6
|
export { TgoCodingTestCandidateViewComponent } from './lib/components/tgo-coding-test-candidate-view/tgo-coding-test-candidate-view.component';
|
|
7
|
+
// Note: CodingTestModule is kept internal for now and not exposed in the public API
|
|
8
|
+
// export * from './lib/components/coding-test.module';
|
|
3
9
|
export { Config as LibCodingConfig } from './lib/models/configs';
|
|
4
|
-
export {
|
|
10
|
+
export {
|
|
11
|
+
CustomTestCase,
|
|
12
|
+
ExampleTestCase,
|
|
13
|
+
TestCaseResult,
|
|
14
|
+
TestCaseDeletionAction,
|
|
15
|
+
TestCaseDeletionData,
|
|
16
|
+
} from './lib/models/test-cases';
|
|
5
17
|
export { Themes } from './lib/models/theme';
|
|
6
18
|
export { ViewMode } from './lib/models/view-mode';
|
|
7
19
|
export { LATLanguage, LATLanguages } from './lib/models/lat-languages';
|
|
@@ -10,4 +22,9 @@ export { Modes } from './lib/models/mode';
|
|
|
10
22
|
export { LibCodingTestService, ResetCodeAction } from './lib/services/lib-coding-test.service';
|
|
11
23
|
export { StorageCodingService } from './lib/services/storage.service';
|
|
12
24
|
export { CodingTestConfigService } from './lib/services/coding-test-config.service';
|
|
13
|
-
|
|
25
|
+
|
|
26
|
+
// Configuration exports
|
|
27
|
+
export {
|
|
28
|
+
TgoCodingTestConfig,
|
|
29
|
+
provideTgoCodingTest,
|
|
30
|
+
} from './lib/config';
|
|
File without changes
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
display: block;
|
|
3
|
+
height: 100%;
|
|
4
|
+
max-width: 100%;
|
|
5
|
+
max-height: 100%;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.container {
|
|
9
|
+
height: 100%;
|
|
10
|
+
background-color: var(--code-editor-background);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.editor {
|
|
14
|
+
height: 100%;
|
|
15
|
+
|
|
16
|
+
::ng-deep {
|
|
17
|
+
.copy-pasted-code {
|
|
18
|
+
background-color: yellow;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { NO_ERRORS_SCHEMA, SimpleChange, SimpleChanges } from '@angular/core';
|
|
2
|
+
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
|
3
|
+
import { MockProvider } from 'ng-mocks';
|
|
4
|
+
import { Observable, ReplaySubject } from 'rxjs';
|
|
5
|
+
|
|
6
|
+
import { LibCodingTestService } from '../../services/lib-coding-test.service';
|
|
7
|
+
import { StorageCodingService } from '../../services/storage.service';
|
|
8
|
+
import { CodeEditorComponent } from './code-editor.component';
|
|
9
|
+
import { editorMock, functionParamsMock, initCodeMock } from './code-editor.mocks';
|
|
10
|
+
import { CodeEditorService } from './code-editor.service';
|
|
11
|
+
import { CodeEditorLanguages } from './helpers/code-editor-helper.model';
|
|
12
|
+
import { CONFIGURATIONS_SERVICE_MOCK } from '../../services/configurations.service.mocks';
|
|
13
|
+
import { ConfigurationsService } from '../../services/configurations.service';
|
|
14
|
+
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
|
15
|
+
import { MonacoEditorModule } from 'ngx-monaco-editor-v2';
|
|
16
|
+
|
|
17
|
+
describe('CodeEditorComponent', () => {
|
|
18
|
+
let component: CodeEditorComponent;
|
|
19
|
+
let fixture: ComponentFixture<CodeEditorComponent>;
|
|
20
|
+
|
|
21
|
+
let codeEditorService: CodeEditorService;
|
|
22
|
+
let libCodingTestService: LibCodingTestService;
|
|
23
|
+
|
|
24
|
+
let setHelperSpy: jest.SpyInstance;
|
|
25
|
+
let getEditorLangSpy: jest.SpyInstance;
|
|
26
|
+
let getInitCodeSpy: jest.SpyInstance;
|
|
27
|
+
let codeChangeSpy: jest.SpyInstance;
|
|
28
|
+
let pasteEventSpy: jest.SpyInstance;
|
|
29
|
+
|
|
30
|
+
const currentLanguage = CodeEditorLanguages.Python;
|
|
31
|
+
|
|
32
|
+
beforeEach(waitForAsync(() => {
|
|
33
|
+
TestBed.configureTestingModule({
|
|
34
|
+
imports: [CodeEditorComponent, MonacoEditorModule.forRoot(), NoopAnimationsModule],
|
|
35
|
+
schemas: [NO_ERRORS_SCHEMA],
|
|
36
|
+
providers: [
|
|
37
|
+
MockProvider(CodeEditorService, {
|
|
38
|
+
getEditorLang: () => currentLanguage,
|
|
39
|
+
}),
|
|
40
|
+
MockProvider(LibCodingTestService, {
|
|
41
|
+
codeReset$: new Observable(),
|
|
42
|
+
currentLanguage$: new ReplaySubject(1),
|
|
43
|
+
changeCurrentLanguage(value: CodeEditorLanguages): void {
|
|
44
|
+
this.currentLanguage$.next(value);
|
|
45
|
+
},
|
|
46
|
+
}),
|
|
47
|
+
MockProvider(ConfigurationsService, CONFIGURATIONS_SERVICE_MOCK),
|
|
48
|
+
MockProvider(StorageCodingService),
|
|
49
|
+
],
|
|
50
|
+
}).compileComponents();
|
|
51
|
+
}));
|
|
52
|
+
|
|
53
|
+
beforeEach(() => {
|
|
54
|
+
fixture = TestBed.createComponent(CodeEditorComponent);
|
|
55
|
+
component = fixture.componentInstance;
|
|
56
|
+
component.functionParams = [...functionParamsMock];
|
|
57
|
+
component.functionName = 'mockFunction';
|
|
58
|
+
component.returnType = 'boolean';
|
|
59
|
+
component.hasCodingConfigPanel = true;
|
|
60
|
+
component.isReadonly = false;
|
|
61
|
+
component.initCode = initCodeMock;
|
|
62
|
+
component.shouldGenerateInitCode = true;
|
|
63
|
+
|
|
64
|
+
codeEditorService = TestBed.inject(CodeEditorService);
|
|
65
|
+
libCodingTestService = TestBed.inject(LibCodingTestService);
|
|
66
|
+
setHelperSpy = jest.spyOn(codeEditorService, 'setHelper');
|
|
67
|
+
getEditorLangSpy = jest.spyOn(codeEditorService, 'getEditorLang');
|
|
68
|
+
getInitCodeSpy = jest.spyOn(codeEditorService, 'getInitCode');
|
|
69
|
+
codeChangeSpy = jest.spyOn(component.codeChange, 'emit');
|
|
70
|
+
|
|
71
|
+
libCodingTestService.changeCurrentLanguage(currentLanguage);
|
|
72
|
+
fixture.detectChanges();
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
describe('when initialized', () => {
|
|
76
|
+
beforeEach(() => {
|
|
77
|
+
component.editor = editorMock;
|
|
78
|
+
pasteEventSpy = jest.spyOn(component.editor, 'onDidPaste');
|
|
79
|
+
component.initEditor(editorMock);
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
it('should set configurations', () => {
|
|
83
|
+
const params = {
|
|
84
|
+
params: component.functionParams,
|
|
85
|
+
name: component.functionName,
|
|
86
|
+
returnType: component.returnType,
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
expect(setHelperSpy).toBeCalledWith(currentLanguage, params);
|
|
90
|
+
expect(getEditorLangSpy).toBeCalled();
|
|
91
|
+
expect(component.editorOptions.language).toEqual(currentLanguage);
|
|
92
|
+
expect(component.editorOptions.readOnly).toEqual(component.isReadonly);
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
describe('and has initCode passed', () => {
|
|
96
|
+
it('should set passed init code to local code', () => {
|
|
97
|
+
expect(component.code).toEqual(initCodeMock);
|
|
98
|
+
});
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
describe('and has NO initCode passed and has shouldGenerateInitCode = true', () => {
|
|
102
|
+
beforeEach(() => {
|
|
103
|
+
component.initCode = '';
|
|
104
|
+
component.shouldGenerateInitCode = true;
|
|
105
|
+
component.ngOnInit();
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
it('should get init code from service', () => {
|
|
109
|
+
expect(getInitCodeSpy).toBeCalled();
|
|
110
|
+
});
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
it('should publish updated init code', () => {
|
|
114
|
+
expect(component.codePublished).toEqual(component.code);
|
|
115
|
+
expect(codeChangeSpy).toBeCalledWith(component.codePublished);
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
it('should listen to paste editor event', () => {
|
|
119
|
+
expect(pasteEventSpy).toHaveBeenCalled();
|
|
120
|
+
});
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
describe('when initCode changes', () => {
|
|
124
|
+
it('should update code passed to the editor', () => {
|
|
125
|
+
const oldInitCode = component.initCode;
|
|
126
|
+
const newInitCode = 'sample java code';
|
|
127
|
+
component.initCode = newInitCode;
|
|
128
|
+
const changes: SimpleChanges = {
|
|
129
|
+
initCode: new SimpleChange(oldInitCode, newInitCode, false),
|
|
130
|
+
};
|
|
131
|
+
component.ngOnChanges(changes);
|
|
132
|
+
|
|
133
|
+
expect(component.code).toEqual(newInitCode);
|
|
134
|
+
});
|
|
135
|
+
});
|
|
136
|
+
});
|