Skip to content

Commit

Permalink
Merge pull request #4 from Hiroshiba/hiho-counter-pr-4d981464
Browse files Browse the repository at this point in the history
VOICEVOX#2420 の変更提案プルリクエスト
  • Loading branch information
jdkfx authored Dec 22, 2024
2 parents 6891dcb + 4d98146 commit 83e9b11
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
13 changes: 8 additions & 5 deletions src/components/Talk/AccentPhrase.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
<template>
<div
ref="container"
class="mora-table"
:class="[isActive && 'mora-table-focus', uiLocked || 'mora-table-hover']"
class="accent-phrase"
:class="[
isActive && 'accent-phrase-focus',
uiLocked || 'accent-phrase-hover',
]"
@click="$emit('click', index)"
>
<ContextMenu :menudata="contextMenudata" />
Expand Down Expand Up @@ -468,7 +471,7 @@ const handleChangeVoicing = (mora: Mora, moraIndex: number) => {
position: relative;
}
.mora-table {
.accent-phrase {
display: inline-grid;
align-self: stretch;
grid-template-rows: 1fr 60px 30px;
Expand All @@ -478,12 +481,12 @@ const handleChangeVoicing = (mora: Mora, moraIndex: number) => {
}
}
.mora-table-hover:hover {
.accent-phrase-hover:hover {
cursor: pointer;
background-color: colors.$active-point-hover;
}
.mora-table-focus {
.accent-phrase-focus {
// hover色に負けるので、importantが必要
background-color: colors.$active-point-focus !important;
}
Expand Down
13 changes: 8 additions & 5 deletions tests/e2e/browser/アクセント.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,15 @@ test("アクセントの読み部分をクリックすると読みを変更で
await page.getByRole("textbox", { name: "1行目" }).click();
await page.getByRole("textbox", { name: "1行目" }).fill("テストです");
await page.getByRole("textbox", { name: "1行目" }).press("Enter");
await page.locator(".text-cell").first().waitFor();
const accentPhrase = page.locator(".accent-phrase");
await expect(accentPhrase).toHaveText("テストデス");

await expect(page.locator(".text-cell").first()).toBeVisible();
await page.locator(".text-cell").first().click();
const qMenu = page.locator(".q-menu > label > div > div > div");
expect(await qMenu.first().inputValue()).toBe("テストデス");
await qMenu.fill("テストテスト");
expect(await qMenu.first().inputValue()).toBe("テストテスト");
const input = page.getByLabel("1番目のアクセント区間の読み");
await input.evaluate((node) => console.log(node.outerHTML));
expect(await input.inputValue()).toBe("テストデス");
await input.fill("テストテスト");
await input.press("Enter");
await expect(accentPhrase).toHaveText("テストテスト");
});

0 comments on commit 83e9b11

Please sign in to comment.