Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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="[
Comment on lines -4 to +5
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

「コンポーネント名と同じクラス名はテストでも使って良い」というVOICEVOXの独自方針があるので、クラス名を変えちゃいました!

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 @@ -10,7 +10,7 @@
await page.locator(".audio-cell input").first().fill("こんにちは");
await page.locator(".audio-cell input").first().press("Enter");
await page.waitForTimeout(500);
expect(await page.locator(".mora-table").count()).toBe(1);

Check failure on line 13 in tests/e2e/browser/アクセント.spec.ts

View workflow job for this annotation

GitHub Actions / e2e-test (ubuntu-latest)

[browser] › browser/アクセント.spec.ts:7:5 › アクセント分割したらアクセント区間が増える

1) [browser] › browser/アクセント.spec.ts:7:5 › アクセント分割したらアクセント区間が増える ───────────────────────────────── Error: expect(received).toBe(expected) // Object.is equality Expected: 1 Received: 0 11 | await page.locator(".audio-cell input").first().press("Enter"); 12 | await page.waitForTimeout(500); > 13 | expect(await page.locator(".mora-table").count()).toBe(1); | ^ 14 | await (await page.locator(".splitter-cell").all())[1].click(); 15 | await page.waitForTimeout(500); 16 | expect(await page.locator(".mora-table").count()).toBe(2); at /home/runner/work/voicevox/voicevox/tests/e2e/browser/アクセント.spec.ts:13:53

Check failure on line 13 in tests/e2e/browser/アクセント.spec.ts

View workflow job for this annotation

GitHub Actions / e2e-test (ubuntu-latest)

[browser] › browser/アクセント.spec.ts:7:5 › アクセント分割したらアクセント区間が増える

1) [browser] › browser/アクセント.spec.ts:7:5 › アクセント分割したらアクセント区間が増える ───────────────────────────────── Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Error: expect(received).toBe(expected) // Object.is equality Expected: 1 Received: 0 11 | await page.locator(".audio-cell input").first().press("Enter"); 12 | await page.waitForTimeout(500); > 13 | expect(await page.locator(".mora-table").count()).toBe(1); | ^ 14 | await (await page.locator(".splitter-cell").all())[1].click(); 15 | await page.waitForTimeout(500); 16 | expect(await page.locator(".mora-table").count()).toBe(2); at /home/runner/work/voicevox/voicevox/tests/e2e/browser/アクセント.spec.ts:13:53

Check failure on line 13 in tests/e2e/browser/アクセント.spec.ts

View workflow job for this annotation

GitHub Actions / e2e-test (ubuntu-latest)

[browser] › browser/アクセント.spec.ts:7:5 › アクセント分割したらアクセント区間が増える

1) [browser] › browser/アクセント.spec.ts:7:5 › アクセント分割したらアクセント区間が増える ───────────────────────────────── Retry #2 ─────────────────────────────────────────────────────────────────────────────────────── Error: expect(received).toBe(expected) // Object.is equality Expected: 1 Received: 0 11 | await page.locator(".audio-cell input").first().press("Enter"); 12 | await page.waitForTimeout(500); > 13 | expect(await page.locator(".mora-table").count()).toBe(1); | ^ 14 | await (await page.locator(".splitter-cell").all())[1].click(); 15 | await page.waitForTimeout(500); 16 | expect(await page.locator(".mora-table").count()).toBe(2); at /home/runner/work/voicevox/voicevox/tests/e2e/browser/アクセント.spec.ts:13:53

Check failure on line 13 in tests/e2e/browser/アクセント.spec.ts

View workflow job for this annotation

GitHub Actions / e2e-test (macos-latest)

[browser] › browser/アクセント.spec.ts:7:5 › アクセント分割したらアクセント区間が増える

1) [browser] › browser/アクセント.spec.ts:7:5 › アクセント分割したらアクセント区間が増える ───────────────────────────────── Error: expect(received).toBe(expected) // Object.is equality Expected: 1 Received: 0 11 | await page.locator(".audio-cell input").first().press("Enter"); 12 | await page.waitForTimeout(500); > 13 | expect(await page.locator(".mora-table").count()).toBe(1); | ^ 14 | await (await page.locator(".splitter-cell").all())[1].click(); 15 | await page.waitForTimeout(500); 16 | expect(await page.locator(".mora-table").count()).toBe(2); at /Users/runner/work/voicevox/voicevox/tests/e2e/browser/アクセント.spec.ts:13:53

Check failure on line 13 in tests/e2e/browser/アクセント.spec.ts

View workflow job for this annotation

GitHub Actions / e2e-test (macos-latest)

[browser] › browser/アクセント.spec.ts:7:5 › アクセント分割したらアクセント区間が増える

1) [browser] › browser/アクセント.spec.ts:7:5 › アクセント分割したらアクセント区間が増える ───────────────────────────────── Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Error: expect(received).toBe(expected) // Object.is equality Expected: 1 Received: 0 11 | await page.locator(".audio-cell input").first().press("Enter"); 12 | await page.waitForTimeout(500); > 13 | expect(await page.locator(".mora-table").count()).toBe(1); | ^ 14 | await (await page.locator(".splitter-cell").all())[1].click(); 15 | await page.waitForTimeout(500); 16 | expect(await page.locator(".mora-table").count()).toBe(2); at /Users/runner/work/voicevox/voicevox/tests/e2e/browser/アクセント.spec.ts:13:53

Check failure on line 13 in tests/e2e/browser/アクセント.spec.ts

View workflow job for this annotation

GitHub Actions / e2e-test (macos-latest)

[browser] › browser/アクセント.spec.ts:7:5 › アクセント分割したらアクセント区間が増える

1) [browser] › browser/アクセント.spec.ts:7:5 › アクセント分割したらアクセント区間が増える ───────────────────────────────── Retry #2 ─────────────────────────────────────────────────────────────────────────────────────── Error: expect(received).toBe(expected) // Object.is equality Expected: 1 Received: 0 11 | await page.locator(".audio-cell input").first().press("Enter"); 12 | await page.waitForTimeout(500); > 13 | expect(await page.locator(".mora-table").count()).toBe(1); | ^ 14 | await (await page.locator(".splitter-cell").all())[1].click(); 15 | await page.waitForTimeout(500); 16 | expect(await page.locator(".mora-table").count()).toBe(2); at /Users/runner/work/voicevox/voicevox/tests/e2e/browser/アクセント.spec.ts:13:53
await (await page.locator(".splitter-cell").all())[1].click();
await page.waitForTimeout(500);
expect(await page.locator(".mora-table").count()).toBe(2);
Expand All @@ -24,12 +24,15 @@
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("テストテスト");
});
Loading