0
0

Fix widget tests (#9591)

This commit is contained in:
Masaya Suzuki 2023-01-15 20:55:09 +09:00 committed by GitHub
parent 3e9f88506e
commit 94004b7a3f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
20 changed files with 20 additions and 20 deletions

View File

@ -39,7 +39,7 @@ describe('After user signed in', () => {
cy.get('.mk-widget-select select').select(widgetName, { force: true }); cy.get('.mk-widget-select select').select(widgetName, { force: true });
cy.get('.data-cy-bg._modalBg.data-cy-transparent').click({ multiple: true, force: true }); cy.get('.data-cy-bg._modalBg.data-cy-transparent').click({ multiple: true, force: true });
cy.get('.mk-widget-add').click({ force: true }); cy.get('.mk-widget-add').click({ force: true });
cy.get(`.mkw-${widgetName}`).should('exist'); cy.get(`.data-cy-mkw-${widgetName}`).should('exist');
}); });
} }

View File

@ -1,5 +1,5 @@
<template> <template>
<MkContainer :show-header="widgetProps.showHeader" :naked="widgetProps.transparent" class="mkw-activity"> <MkContainer :show-header="widgetProps.showHeader" :naked="widgetProps.transparent" class="mkw-activity data-cy-mkw-activity">
<template #icon><i class="ti ti-chart-line"></i></template> <template #icon><i class="ti ti-chart-line"></i></template>
<template #header>{{ i18n.ts._widgets.activity }}</template> <template #header>{{ i18n.ts._widgets.activity }}</template>
<template #func="{ buttonStyleClass }"><button class="_button" :class="buttonStyleClass" @click="toggleView()"><i class="ti ti-selector"></i></button></template> <template #func="{ buttonStyleClass }"><button class="_button" :class="buttonStyleClass" @click="toggleView()"><i class="ti ti-selector"></i></button></template>

View File

@ -1,5 +1,5 @@
<template> <template>
<MkContainer :naked="widgetProps.transparent" :show-header="false" class="mkw-aichan"> <MkContainer :naked="widgetProps.transparent" :show-header="false" class="mkw-aichan data-cy-mkw-aichan">
<iframe ref="live2d" class="dedjhjmo" src="https://misskey-dev.github.io/mascot-web/?scale=1.5&y=1.1&eyeY=100" @click="touched"></iframe> <iframe ref="live2d" class="dedjhjmo" src="https://misskey-dev.github.io/mascot-web/?scale=1.5&y=1.1&eyeY=100" @click="touched"></iframe>
</MkContainer> </MkContainer>
</template> </template>

View File

@ -1,5 +1,5 @@
<template> <template>
<MkContainer :show-header="widgetProps.showHeader" class="mkw-aiscript"> <MkContainer :show-header="widgetProps.showHeader" class="mkw-aiscript data-cy-mkw-aiscript">
<template #icon><i class="ti ti-terminal-2"></i></template> <template #icon><i class="ti ti-terminal-2"></i></template>
<template #header>{{ i18n.ts._widgets.aiscript }}</template> <template #header>{{ i18n.ts._widgets.aiscript }}</template>

View File

@ -1,5 +1,5 @@
<template> <template>
<div class="mkw-button"> <div class="mkw-button data-cy-mkw-button">
<MkButton :primary="widgetProps.colored" full @click="run"> <MkButton :primary="widgetProps.colored" full @click="run">
{{ widgetProps.label }} {{ widgetProps.label }}
</MkButton> </MkButton>

View File

@ -1,5 +1,5 @@
<template> <template>
<div :class="[$style.root, { _panel: !widgetProps.transparent }]"> <div :class="[$style.root, { _panel: !widgetProps.transparent }]" class="data-cy-mkw-calendar">
<div :class="[$style.calendar, { [$style.isHoliday]: isHoliday }]"> <div :class="[$style.calendar, { [$style.isHoliday]: isHoliday }]">
<p :class="$style.monthAndYear"> <p :class="$style.monthAndYear">
<span :class="$style.year">{{ $t('yearX', { year }) }}</span> <span :class="$style.year">{{ $t('yearX', { year }) }}</span>

View File

@ -1,5 +1,5 @@
<template> <template>
<MkContainer :naked="widgetProps.transparent" :show-header="false" class="mkw-clock"> <MkContainer :naked="widgetProps.transparent" :show-header="false" class="mkw-clock data-cy-mkw-clock">
<div class="vubelbmv" :class="widgetProps.size"> <div class="vubelbmv" :class="widgetProps.size">
<div v-if="widgetProps.label === 'tz' || widgetProps.label === 'timeAndTz'" class="_monospace label a abbrev">{{ tzAbbrev }}</div> <div v-if="widgetProps.label === 'tz' || widgetProps.label === 'timeAndTz'" class="_monospace label a abbrev">{{ tzAbbrev }}</div>
<MkAnalogClock <MkAnalogClock

View File

@ -1,5 +1,5 @@
<template> <template>
<div class="_monospace" :class="[$style.root, { _panel: !widgetProps.transparent }]" :style="{ fontSize: `${widgetProps.fontSize}em` }"> <div class="data-cy-mkw-digitalClock _monospace" :class="[$style.root, { _panel: !widgetProps.transparent }]" :style="{ fontSize: `${widgetProps.fontSize}em` }">
<div v-if="widgetProps.showLabel" :class="$style.label">{{ tzAbbrev }}</div> <div v-if="widgetProps.showLabel" :class="$style.label">{{ tzAbbrev }}</div>
<div> <div>
<MkDigitalClock :show-ms="widgetProps.showMs" :offset="tzOffset"/> <MkDigitalClock :show-ms="widgetProps.showMs" :offset="tzOffset"/>

View File

@ -1,5 +1,5 @@
<template> <template>
<MkContainer :show-header="widgetProps.showHeader" :foldable="foldable" :scrollable="scrollable" class="mkw-federation"> <MkContainer :show-header="widgetProps.showHeader" :foldable="foldable" :scrollable="scrollable" class="mkw-federation data-cy-mkw-federation">
<template #icon><i class="ti ti-whirl"></i></template> <template #icon><i class="ti ti-whirl"></i></template>
<template #header>{{ i18n.ts._widgets.federation }}</template> <template #header>{{ i18n.ts._widgets.federation }}</template>

View File

@ -1,5 +1,5 @@
<template> <template>
<div class="mkw-jobQueue _monospace" :class="{ _panel: !widgetProps.transparent }"> <div class="mkw-jobQueue data-cy-mkw-jobQueue _monospace" :class="{ _panel: !widgetProps.transparent }">
<div class="inbox"> <div class="inbox">
<div class="label">Inbox queue<i v-if="current.inbox.waiting > 0" class="ti ti-alert-triangle icon"></i></div> <div class="label">Inbox queue<i v-if="current.inbox.waiting > 0" class="ti ti-alert-triangle icon"></i></div>
<div class="values"> <div class="values">

View File

@ -1,5 +1,5 @@
<template> <template>
<MkContainer :show-header="widgetProps.showHeader" class="mkw-memo"> <MkContainer :show-header="widgetProps.showHeader" class="mkw-memo data-cy-mkw-memo">
<template #icon><i class="ti ti-note"></i></template> <template #icon><i class="ti ti-note"></i></template>
<template #header>{{ i18n.ts._widgets.memo }}</template> <template #header>{{ i18n.ts._widgets.memo }}</template>

View File

@ -1,5 +1,5 @@
<template> <template>
<MkContainer :style="`height: ${widgetProps.height}px;`" :show-header="widgetProps.showHeader" :scrollable="true" class="mkw-notifications"> <MkContainer :style="`height: ${widgetProps.height}px;`" :show-header="widgetProps.showHeader" :scrollable="true" class="mkw-notifications data-cy-mkw-notifications">
<template #icon><i class="ti ti-bell"></i></template> <template #icon><i class="ti ti-bell"></i></template>
<template #header>{{ i18n.ts.notifications }}</template> <template #header>{{ i18n.ts.notifications }}</template>
<template #func="{ buttonStyleClass }"><button class="_button" :class="buttonStyleClass" @click="configureNotification()"><i class="ti ti-settings"></i></button></template> <template #func="{ buttonStyleClass }"><button class="_button" :class="buttonStyleClass" @click="configureNotification()"><i class="ti ti-settings"></i></button></template>

View File

@ -1,5 +1,5 @@
<template> <template>
<div class="mkw-onlineUsers" :class="{ _panel: !widgetProps.transparent, pad: !widgetProps.transparent }"> <div class="mkw-onlineUsers data-cy-mkw-onlineUsers" :class="{ _panel: !widgetProps.transparent, pad: !widgetProps.transparent }">
<I18n v-if="onlineUsersCount" :src="i18n.ts.onlineUsersCount" text-tag="span" class="text"> <I18n v-if="onlineUsersCount" :src="i18n.ts.onlineUsersCount" text-tag="span" class="text">
<template #n><b>{{ onlineUsersCount }}</b></template> <template #n><b>{{ onlineUsersCount }}</b></template>
</I18n> </I18n>

View File

@ -1,5 +1,5 @@
<template> <template>
<MkContainer :show-header="widgetProps.showHeader" :naked="widgetProps.transparent" :class="$style.root" :data-transparent="widgetProps.transparent ? true : null" class="mkw-photos"> <MkContainer :show-header="widgetProps.showHeader" :naked="widgetProps.transparent" :class="$style.root" :data-transparent="widgetProps.transparent ? true : null" class="mkw-photos data-cy-mkw-photos">
<template #icon><i class="ti ti-camera"></i></template> <template #icon><i class="ti ti-camera"></i></template>
<template #header>{{ i18n.ts._widgets.photos }}</template> <template #header>{{ i18n.ts._widgets.photos }}</template>

View File

@ -1,5 +1,5 @@
<template> <template>
<XPostForm class="_panel mkw-postForm" :fixed="true" :autofocus="false"/> <XPostForm class="_panel mkw-postForm data-cy-mkw-postForm" :fixed="true" :autofocus="false"/>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>

View File

@ -1,5 +1,5 @@
<template> <template>
<MkContainer :show-header="widgetProps.showHeader" class="mkw-rss"> <MkContainer :show-header="widgetProps.showHeader" class="mkw-rss data-cy-mkw-rss">
<template #icon><i class="ti ti-rss"></i></template> <template #icon><i class="ti ti-rss"></i></template>
<template #header>RSS</template> <template #header>RSS</template>
<template #func="{ buttonStyleClass }"><button class="_button" :class="buttonStyleClass" @click="configure"><i class="ti ti-settings"></i></button></template> <template #func="{ buttonStyleClass }"><button class="_button" :class="buttonStyleClass" @click="configure"><i class="ti ti-settings"></i></button></template>

View File

@ -1,5 +1,5 @@
<template> <template>
<div class="kvausudm _panel mkw-slideshow" :style="{ height: widgetProps.height + 'px' }"> <div class="kvausudm _panel mkw-slideshow data-cy-mkw-slideshow" :style="{ height: widgetProps.height + 'px' }">
<div @click="choose"> <div @click="choose">
<p v-if="widgetProps.folderId == null"> <p v-if="widgetProps.folderId == null">
{{ i18n.ts.folder }} {{ i18n.ts.folder }}

View File

@ -1,5 +1,5 @@
<template> <template>
<MkContainer :show-header="widgetProps.showHeader" :style="`height: ${widgetProps.height}px;`" :scrollable="true" class="mkw-timeline"> <MkContainer :show-header="widgetProps.showHeader" :style="`height: ${widgetProps.height}px;`" :scrollable="true" class="mkw-timeline data-cy-mkw-timeline">
<template #icon> <template #icon>
<i v-if="widgetProps.src === 'home'" class="ti ti-home"></i> <i v-if="widgetProps.src === 'home'" class="ti ti-home"></i>
<i v-else-if="widgetProps.src === 'local'" class="ti ti-planet"></i> <i v-else-if="widgetProps.src === 'local'" class="ti ti-planet"></i>

View File

@ -1,5 +1,5 @@
<template> <template>
<MkContainer :show-header="widgetProps.showHeader" class="mkw-trends"> <MkContainer :show-header="widgetProps.showHeader" class="mkw-trends data-cy-mkw-trends">
<template #icon><i class="ti ti-hash"></i></template> <template #icon><i class="ti ti-hash"></i></template>
<template #header>{{ i18n.ts._widgets.trends }}</template> <template #header>{{ i18n.ts._widgets.trends }}</template>

View File

@ -4,7 +4,7 @@
<template #header>{{ i18n.ts._widgets.serverMetric }}</template> <template #header>{{ i18n.ts._widgets.serverMetric }}</template>
<template #func="{ buttonStyleClass }"><button class="_button" :class="buttonStyleClass" @click="toggleView()"><i class="ti ti-selector"></i></button></template> <template #func="{ buttonStyleClass }"><button class="_button" :class="buttonStyleClass" @click="toggleView()"><i class="ti ti-selector"></i></button></template>
<div v-if="meta" class="mkw-serverMetric"> <div v-if="meta" class="mkw-serverMetric data-cy-mkw-serverMetric">
<XCpuMemory v-if="widgetProps.view === 0" :connection="connection" :meta="meta"/> <XCpuMemory v-if="widgetProps.view === 0" :connection="connection" :meta="meta"/>
<XNet v-else-if="widgetProps.view === 1" :connection="connection" :meta="meta"/> <XNet v-else-if="widgetProps.view === 1" :connection="connection" :meta="meta"/>
<XCpu v-else-if="widgetProps.view === 2" :connection="connection" :meta="meta"/> <XCpu v-else-if="widgetProps.view === 2" :connection="connection" :meta="meta"/>