Skip to content

Commit abf8061

Browse files
author
Arsen Khachaturyan
committed
Initial commit
0 parents  commit abf8061

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+15257
-0
lines changed

LICENSE

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
MIT License
2+
3+
Copyright (c) 2023 arsenk01

README.md

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Angular Technical Test
2+
We've designed a small remote technical test, that is open ended. You should be able to make choices and assumptions without guidance. We're interested in seeing how you think and architect out the code. You should not spend more than 3 hours on this so think strategically about what you want to show.
3+
4+
Clone this repo and send us a link to your work. We will review ASAP and decide whether to invite in for interview.
5+
6+
### Spec:
7+
We want to test your ability to write clean modular angular code that talks to a RESTful API endpoints.
8+
* Build a todo list single page application.
9+
* Add/Edit/Delete todo items
10+
* Mark todo item as done
11+
* Ability to filter items in the todo list
12+
13+
We have set up for you a project and a mock local server.
14+
15+
GET from http://localhost:3000/tasks ← list all todo items
16+
GET /1 ← view detail of a specific todo item, where id = 1
17+
POST ← creates a new todo item (as long as it has an available id)
18+
PATCH /1 ← edits the todo item with id = 1
19+
DELETE /1 ← deletes the todo item, with id = 1
20+
21+
22+
###  We would like to see the following:
23+
24+
* JS code unit tests
25+
* Modular Angular code
26+
* Dependency injection
27+
28+
### Nice to have:
29+
30+
* Some basic styling with SASS. It would be nice if you can demonstrate how to write modular SCSS code
31+
32+
33+
Additional notes:
34+
The frontend is in Angular 8. We used json-server to mock backend. You are free to use any other plugins as you wish.
35+
There is no time constraint, when you’re happy with it, send it to us as well as how much time you spent on it.
36+
Any extra feature you can add will be appreciated.
37+
Whatever you do send please do it to the best of your abilities, please be proud of what you send. Quality > Quantity.
38+
Setup of the project should be easy and detailed.
39+
40+
41+
### Quick start
42+
#### clone the repo
43+
Go to your developer folder
44+
Clone this project repository to your local machine
45+
46+
#### change into the repo directory
47+
`cd tech-test`
48+
49+
#### install
50+
`npm install`
51+
52+
#### serve
53+
`npm run server`
54+
`npm run start`
55+
56+
#### Running unit tests
57+
`npm run test`
58+

tech-test/.editorconfig

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Editor configuration, see https://editorconfig.org
2+
root = true
3+
4+
[*]
5+
charset = utf-8
6+
indent_style = space
7+
indent_size = 2
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.md]
12+
max_line_length = off
13+
trim_trailing_whitespace = false

tech-test/.gitignore

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# See http://help.github.com/ignore-files/ for more about ignoring files.
2+
3+
# compiled output
4+
/dist
5+
/tmp
6+
/out-tsc
7+
# Only exists if Bazel was run
8+
/bazel-out
9+
10+
# dependencies
11+
/node_modules
12+
13+
# profiling files
14+
chrome-profiler-events*.json
15+
speed-measure-plugin*.json
16+
17+
# IDEs and editors
18+
/.idea
19+
.project
20+
.classpath
21+
.c9/
22+
*.launch
23+
.settings/
24+
*.sublime-workspace
25+
26+
# IDE - VSCode
27+
.vscode/*
28+
!.vscode/settings.json
29+
!.vscode/tasks.json
30+
!.vscode/launch.json
31+
!.vscode/extensions.json
32+
.history/*
33+
34+
# misc
35+
/.sass-cache
36+
/connect.lock
37+
/coverage
38+
/libpeerconnection.log
39+
npm-debug.log
40+
yarn-error.log
41+
testem.log
42+
/typings
43+
44+
# System Files
45+
.DS_Store
46+
Thumbs.db

tech-test/.npmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
legacy-peer-deps=true

tech-test/.vscode/launch.json

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"type": "chrome",
9+
"request": "launch",
10+
"name": "Launch Chrome against localhost",
11+
"url": "http://localhost:8080",
12+
"webRoot": "${workspaceFolder}"
13+
}
14+
]
15+
}

tech-test/README.md

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# TechTest
2+
3+
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 8.3.19.
4+
5+
## Development server
6+
7+
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
8+
# Note:
9+
If you run into issue "Error: error:0308010C:digital envelope routines::unsupported" then run the command `export NODE_OPTIONS=--openssl-legacy-provider`, which is a workaround for the webpack issue (check [here](https://github.com/webpack/webpack/issues/14532)).
10+
11+
## Code scaffolding
12+
13+
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
14+
15+
## Build
16+
17+
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build.
18+
19+
## Running unit tests
20+
21+
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
22+
23+
## Running end-to-end tests
24+
25+
Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
26+
27+
## Further help
28+
29+
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).

tech-test/angular.json

+136
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
{
2+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3+
"version": 1,
4+
"newProjectRoot": "projects",
5+
"projects": {
6+
"tech-test": {
7+
"projectType": "application",
8+
"schematics": {
9+
"@schematics/angular:component": {
10+
"style": "scss"
11+
}
12+
},
13+
"root": "",
14+
"sourceRoot": "src",
15+
"prefix": "app",
16+
"architect": {
17+
"build": {
18+
"builder": "@angular-devkit/build-angular:browser",
19+
"options": {
20+
"outputPath": "dist/tech-test",
21+
"index": "src/index.html",
22+
"main": "src/main.ts",
23+
"polyfills": "src/polyfills.ts",
24+
"tsConfig": "tsconfig.app.json",
25+
"aot": true,
26+
"assets": [
27+
"src/favicon.ico",
28+
"src/assets"
29+
],
30+
"styles": [
31+
"src/styles.scss",
32+
"node_modules/bootstrap/scss/bootstrap.scss",
33+
"node_modules/bootstrap-icons/font/bootstrap-icons.scss"
34+
],
35+
"scripts": [ "./node_modules/bootstrap/dist/js/bootstrap.bundle.min.js"]
36+
},
37+
"configurations": {
38+
"production": {
39+
"fileReplacements": [
40+
{
41+
"replace": "src/environments/environment.ts",
42+
"with": "src/environments/environment.prod.ts"
43+
}
44+
],
45+
"optimization": true,
46+
"outputHashing": "all",
47+
"sourceMap": false,
48+
"extractCss": true,
49+
"namedChunks": false,
50+
"extractLicenses": true,
51+
"vendorChunk": false,
52+
"buildOptimizer": true,
53+
"aot": true,
54+
"budgets": [
55+
{
56+
"type": "initial",
57+
"maximumWarning": "2mb",
58+
"maximumError": "5mb"
59+
},
60+
{
61+
"type": "anyComponentStyle",
62+
"maximumWarning": "6kb",
63+
"maximumError": "10kb"
64+
}
65+
]
66+
}
67+
}
68+
},
69+
"serve": {
70+
"builder": "@angular-devkit/build-angular:dev-server",
71+
"options": {
72+
"browserTarget": "tech-test:build",
73+
"sourceMap": {
74+
"scripts": true,
75+
"styles": true,
76+
"vendor": true
77+
}
78+
},
79+
"configurations": {
80+
"production": {
81+
"browserTarget": "tech-test:build:production"
82+
}
83+
}
84+
},
85+
"extract-i18n": {
86+
"builder": "@angular-devkit/build-angular:extract-i18n",
87+
"options": {
88+
"browserTarget": "tech-test:build"
89+
}
90+
},
91+
"test": {
92+
"builder": "@angular-devkit/build-angular:karma",
93+
"options": {
94+
"main": "src/test.ts",
95+
"polyfills": "src/polyfills.ts",
96+
"tsConfig": "tsconfig.spec.json",
97+
"karmaConfig": "karma.conf.js",
98+
"assets": [
99+
"src/favicon.ico",
100+
"src/assets"
101+
],
102+
"styles": [
103+
"src/styles.scss"
104+
],
105+
"scripts": []
106+
}
107+
},
108+
"lint": {
109+
"builder": "@angular-devkit/build-angular:tslint",
110+
"options": {
111+
"tsConfig": [
112+
"tsconfig.app.json",
113+
"tsconfig.spec.json",
114+
"e2e/tsconfig.json"
115+
],
116+
"exclude": [
117+
"**/node_modules/**"
118+
]
119+
}
120+
},
121+
"e2e": {
122+
"builder": "@angular-devkit/build-angular:protractor",
123+
"options": {
124+
"protractorConfig": "e2e/protractor.conf.js",
125+
"devServerTarget": "tech-test:serve"
126+
},
127+
"configurations": {
128+
"production": {
129+
"devServerTarget": "tech-test:serve:production"
130+
}
131+
}
132+
}
133+
}
134+
}},
135+
"defaultProject": "tech-test"
136+
}

tech-test/browserslist

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
2+
# For additional information regarding the format and rule options, please see:
3+
# https://github.com/browserslist/browserslist#queries
4+
5+
# You can see what browsers were selected by your queries by running:
6+
# npx browserslist
7+
8+
> 0.5%
9+
last 2 versions
10+
Firefox ESR
11+
not dead
12+
not IE 9-11 # For IE 9-11 support, remove 'not'.

tech-test/e2e/protractor.conf.js

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// @ts-check
2+
// Protractor configuration file, see link for more information
3+
// https://github.com/angular/protractor/blob/master/lib/config.ts
4+
5+
const { SpecReporter } = require('jasmine-spec-reporter');
6+
7+
/**
8+
* @type { import("protractor").Config }
9+
*/
10+
exports.config = {
11+
allScriptsTimeout: 11000,
12+
specs: [
13+
'./src/**/*.e2e-spec.ts'
14+
],
15+
capabilities: {
16+
browserName: 'chrome'
17+
},
18+
directConnect: true,
19+
baseUrl: 'http://localhost:4200/',
20+
framework: 'jasmine',
21+
jasmineNodeOpts: {
22+
showColors: true,
23+
defaultTimeoutInterval: 30000,
24+
print: function() {}
25+
},
26+
onPrepare() {
27+
require('ts-node').register({
28+
project: require('path').join(__dirname, './tsconfig.json')
29+
});
30+
jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
31+
}
32+
};

tech-test/e2e/src/app.e2e-spec.ts

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { AppPage } from './app.po';
2+
import { browser, logging } from 'protractor';
3+
4+
describe('workspace-project App', () => {
5+
let page: AppPage;
6+
7+
beforeEach(() => {
8+
page = new AppPage();
9+
});
10+
11+
it('should display welcome message', () => {
12+
page.navigateTo();
13+
expect(page.getTitleText()).toEqual('tech-test app is running!');
14+
});
15+
16+
afterEach(async () => {
17+
// Assert that there are no errors emitted from the browser
18+
const logs = await browser.manage().logs().get(logging.Type.BROWSER);
19+
expect(logs).not.toContain(jasmine.objectContaining({
20+
level: logging.Level.SEVERE,
21+
} as logging.Entry));
22+
});
23+
});

tech-test/e2e/src/app.po.ts

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { browser, by, element } from 'protractor';
2+
3+
export class AppPage {
4+
navigateTo() {
5+
return browser.get(browser.baseUrl) as Promise<any>;
6+
}
7+
8+
getTitleText() {
9+
return element(by.css('app-root .content span')).getText() as Promise<string>;
10+
}
11+
}

0 commit comments

Comments
 (0)