Skip to content

Commit d8321bb

Browse files
authored
The beginning of frontend tests. 😎 (frain-dev#580)
* complete critical dashboard component test * improve dashboard component test to use service and mock data * add empty states tests for dashboard-component * create Github action for dashboard component test * fix test working directory * remove unused assets * clean up * clean up
1 parent 259f6cf commit d8321bb

38 files changed

+2244
-12302
lines changed

‎.editorconfig

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Editor configuration, see https://editorconfig.org
2+
root = true
3+
4+
[*]
5+
charset = utf-8
6+
indent_style = space
7+
indent_size = 4
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.ts]
12+
quote_type = single
13+
14+
[*.md]
15+
max_line_length = off
16+
trim_trailing_whitespace = false
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Test Convoy Dashboard Component
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
matrix:
15+
node-version: [14.18.0]
16+
17+
steps:
18+
- uses: actions/checkout@v2
19+
- name: Use Node.js ${{ matrix.node-version }}
20+
uses: actions/setup-node@v1
21+
with:
22+
node-version: ${{ matrix.node-version }}
23+
- name: Cache Node.js modules
24+
uses: actions/cache@v2
25+
with:
26+
path: ~/.npm
27+
key: ${{ runner.OS }}-node-${{ hashFiles('**/yarn.lock') }}
28+
restore-keys: |
29+
${{ runner.OS }}-node-
30+
${{ runner.OS }}-
31+
- name: Install dependencies
32+
run: npm install
33+
working-directory: ./web/ui/dashboard-component
34+
- name: Run tests
35+
run: npm run test:prod
36+
working-directory: ./web/ui/dashboard-component

‎web/components/app-portal-angular/projects/convoy-app/src/lib/prism/prism.component.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export class PrismComponent implements AfterViewInit, OnChanges {
1414
constructor() {}
1515

1616
ngAfterViewInit() {
17-
Prism.highlightElement(this.codeEle.nativeElement);
17+
Prism.highlightElement(this.codeEle?.nativeElement);
1818
}
1919

2020
ngOnChanges(): void {

‎web/ui/dashboard-component/angular.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@
3232
"options": {
3333
"main": "projects/convoy-dashboard/src/test.ts",
3434
"tsConfig": "projects/convoy-dashboard/tsconfig.spec.json",
35-
"karmaConfig": "projects/convoy-dashboard/karma.conf.js"
35+
"karmaConfig": "projects/convoy-dashboard/karma.conf.js",
36+
"codeCoverage": true
3637
}
3738
}
3839
}

0 commit comments

Comments
 (0)