From 3960adab8ccfb408366e854019e08a8c1083fcdf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=AC=B4=EB=9D=BC=EC=BF=A0=EB=AA=A8?= Date: Thu, 20 Jun 2024 04:13:01 +0900 Subject: [PATCH] fix(test): lint & e2e test (#24) * test(e2e): add isRoot value * fix(lint): frontend linting --- packages/backend/test/e2e/users.ts | 2 ++ packages/frontend/src/components/MkNote.vue | 2 +- packages/frontend/src/components/MkNoteDetailed.vue | 2 +- packages/frontend/src/pages/admin/overview.stats.vue | 4 ++-- packages/frontend/src/scripts/get-note-menu.ts | 2 +- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/packages/backend/test/e2e/users.ts b/packages/backend/test/e2e/users.ts index 1d0d53846..5dc9f7c66 100644 --- a/packages/backend/test/e2e/users.ts +++ b/packages/backend/test/e2e/users.ts @@ -48,6 +48,7 @@ describe('ユーザー', () => { // BUG isAdmin/isModeratorはUserLiteではなくMeDetailedOnlyに含まれる。 isAdmin: undefined, isModerator: undefined, + isRoot: undefined, }); }; @@ -117,6 +118,7 @@ describe('ユーザー', () => { bannerId: user.bannerId, isModerator: user.isModerator, isAdmin: user.isAdmin, + isRoot: user.isRoot, injectFeaturedNote: user.injectFeaturedNote, receiveAnnouncementEmail: user.receiveAnnouncementEmail, alwaysMarkNsfw: user.alwaysMarkNsfw, diff --git a/packages/frontend/src/components/MkNote.vue b/packages/frontend/src/components/MkNote.vue index b88eeb484..d9d08e68a 100644 --- a/packages/frontend/src/components/MkNote.vue +++ b/packages/frontend/src/components/MkNote.vue @@ -196,7 +196,7 @@ import MkRippleEffect from '@/components/MkRippleEffect.vue'; import { showMovedDialog } from '@/scripts/show-moved-dialog.js'; import { shouldCollapsed } from '@/scripts/collapsed.js'; import { isEnabledUrlPreview } from '@/instance.js'; -import {miLocalStorage} from "@/local-storage.js"; +import { miLocalStorage } from "@/local-storage.js"; const props = withDefaults(defineProps<{ note: Misskey.entities.Note; diff --git a/packages/frontend/src/components/MkNoteDetailed.vue b/packages/frontend/src/components/MkNoteDetailed.vue index 70937d102..9d5bc482d 100644 --- a/packages/frontend/src/components/MkNoteDetailed.vue +++ b/packages/frontend/src/components/MkNoteDetailed.vue @@ -236,7 +236,7 @@ import MkPagination, { type Paging } from '@/components/MkPagination.vue'; import MkReactionIcon from '@/components/MkReactionIcon.vue'; import MkButton from '@/components/MkButton.vue'; import { isEnabledUrlPreview } from '@/instance.js'; -import {miLocalStorage} from "@/local-storage.js"; +import { miLocalStorage } from "@/local-storage.js"; const props = withDefaults(defineProps<{ note: Misskey.entities.Note; diff --git a/packages/frontend/src/pages/admin/overview.stats.vue b/packages/frontend/src/pages/admin/overview.stats.vue index 89f53c332..84b1f9b98 100644 --- a/packages/frontend/src/pages/admin/overview.stats.vue +++ b/packages/frontend/src/pages/admin/overview.stats.vue @@ -85,11 +85,11 @@ onMounted(async () => { onlineUsersCount.value = _onlineUsersCount; misskeyApiGet('charts/users', { limit: 2, span: 'day' }).then(chart => { - usersComparedToThePrevDay.value = stats.value?.originalUsersCount! - chart.local.total[1]; + usersComparedToThePrevDay.value = stats.value?.originalUsersCount ?? 0 - chart.local.total[1]; }); misskeyApiGet('charts/notes', { limit: 2, span: 'day' }).then(chart => { - notesComparedToThePrevDay.value = stats.value?.originalNotesCount! - chart.local.total[1]; + notesComparedToThePrevDay.value = stats.value?.originalNotesCount ?? 0 - chart.local.total[1]; }); fetching.value = false; diff --git a/packages/frontend/src/scripts/get-note-menu.ts b/packages/frontend/src/scripts/get-note-menu.ts index 359e8b379..b743c524f 100644 --- a/packages/frontend/src/scripts/get-note-menu.ts +++ b/packages/frontend/src/scripts/get-note-menu.ts @@ -321,7 +321,7 @@ export function getNoteMenu(props: { text: i18n.ts.share, action: share, }] : []), - $i && $i.policies.canUseTranslator && instance.translatorAvailable && !defaultStore.state.showTranslateButtonInNoteFooter? { + $i && $i.policies.canUseTranslator && instance.translatorAvailable && !defaultStore.state.showTranslateButtonInNoteFooter ? { icon: 'ti ti-language-hiragana', text: i18n.ts.translate, action: translate,