From 7e702aa107e61e67ae1637f8ec6bcf81ff0c7070 Mon Sep 17 00:00:00 2001 From: Yehor Butko Date: Fri, 30 Aug 2019 14:34:51 +0300 Subject: [PATCH] web/satellite: navigation, button and project members unit tests (#2907) --- .../src/components/common/Button.vue | 3 +- .../components/navigation/NavigationArea.vue | 12 +- .../components/navigation/navigationArea.html | 1 - .../components/notifications/Notification.vue | 2 +- .../src/components/team/HeaderArea.vue | 23 +- .../components/team/ProjectMembersArea.vue | 13 +- web/satellite/src/store/modules/projects.ts | 5 +- web/satellite/src/types/projectMembers.ts | 12 + web/satellite/src/views/Dashboard.vue | 10 +- web/satellite/src/views/register/Register.vue | 2 +- .../tests/unit/common/Button.spec.ts | 29 +- .../navigation/TabNavigation.spec.ts | 1 - .../__snapshots__/navigationArea.spec.ts.snap | 185 ++++++++++ .../navigation/navigationArea.spec.ts | 77 ++++ web/satellite/tests/unit/mock/api/credits.ts | 19 + .../tests/unit/mock/api/projectMembers.ts | 28 ++ web/satellite/tests/unit/mock/api/projects.ts | 34 ++ web/satellite/tests/unit/mock/api/users.ts | 23 ++ .../unit/projectMembers/HeaderArea.spec.ts | 332 ++++++------------ .../projectMembers/ProjectMembersArea.spec.ts | 75 ++-- .../__snapshots__/HeaderArea.spec.ts.snap | 82 ++++- .../ProjectMembersArea.spec.ts.snap | 63 +++- .../unit/referralStats/referralStats.spec.ts | 24 +- web/satellite/tslint.json | 1 + 24 files changed, 737 insertions(+), 319 deletions(-) create mode 100644 web/satellite/tests/unit/components/navigation/__snapshots__/navigationArea.spec.ts.snap create mode 100644 web/satellite/tests/unit/components/navigation/navigationArea.spec.ts create mode 100644 web/satellite/tests/unit/mock/api/credits.ts create mode 100644 web/satellite/tests/unit/mock/api/projectMembers.ts create mode 100644 web/satellite/tests/unit/mock/api/projects.ts create mode 100644 web/satellite/tests/unit/mock/api/users.ts diff --git a/web/satellite/src/components/common/Button.vue b/web/satellite/src/components/common/Button.vue index 5706d1213..873318b83 100644 --- a/web/satellite/src/components/common/Button.vue +++ b/web/satellite/src/components/common/Button.vue @@ -29,8 +29,7 @@ private readonly isDeletion: boolean; @Prop({default: false}) private isDisabled: boolean; - // TODO: improve default implementation - @Prop({default: () => console.error('onPress is not reinitialized')}) + @Prop({default: () => { return; }}) private readonly onPress: Function; public get style(): Object { diff --git a/web/satellite/src/components/navigation/NavigationArea.vue b/web/satellite/src/components/navigation/NavigationArea.vue index 64c080b55..60fbd9075 100644 --- a/web/satellite/src/components/navigation/NavigationArea.vue +++ b/web/satellite/src/components/navigation/NavigationArea.vue @@ -5,16 +5,10 @@ diff --git a/web/satellite/src/components/team/ProjectMembersArea.vue b/web/satellite/src/components/team/ProjectMembersArea.vue index 2923758d5..3a95284ba 100644 --- a/web/satellite/src/components/team/ProjectMembersArea.vue +++ b/web/satellite/src/components/team/ProjectMembersArea.vue @@ -4,7 +4,7 @@