Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 58706bb

Browse files
committedMar 12, 2024·
trying to fix test failed
1 parent 40d4b52 commit 58706bb

File tree

5 files changed

+14
-11
lines changed

5 files changed

+14
-11
lines changed
 

‎src/components/TailwindScope.tsx

+6-3
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,15 @@ import ReactShadowRoot from 'react-shadow-root';
99
* @param {boolean} [props.dark] - Optional. Specifies whether the dark mode should be applied.
1010
* @returns {JSX.Element} The rendered TailwindScope component.
1111
*/
12-
function TailwindScope({ children, dark }: { children: React.ReactNode, dark?: boolean }): JSX.Element {
12+
function TailwindScope({ children, dark, styles }: { children: React.ReactNode, dark?: boolean, styles?: string[] }): JSX.Element {
1313
return (
1414
<div className={dark === true ? `dark` : ''}>
1515
<ReactShadowRoot>
16-
<style>{styleText}</style>
17-
{children}
16+
<style key="tailwind">{styleText}</style>
17+
{styles?.map((style, i) => <style key={i}>{style}</style>)}
18+
<div className="relative z-[3000]">
19+
{children}
20+
</div>
1821
</ReactShadowRoot>
1922
</div>
2023
)

‎src/features/jimaku/components/JimakuLine.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ function JimakuLine({ item, show, index, observer }: JimakuLineProps): JSX.Eleme
2424
const ref = useRowOptimizer<HTMLParagraphElement>(observer)
2525

2626
return (
27-
<p ref={ref} onContextMenu={show} jimaku-hash={item.hash} jimaku-uid={item.uid} jimaku-index={index}>
27+
<p ref={ref} onContextMenu={show} jimaku-hash={item.hash} jimaku-index={index}>
2828
{item.text}
2929
</p>
3030
)

‎tests/content.spec.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ test('測試主元素是否存在', async ({ content }) => {
1111
await expect(csui.locator('#bjf-root')).toBeAttached()
1212
})
1313

14-
test('测试扩展CSS有否影响到外围', async ({ content, room }) => {
14+
test('测试扩展CSS有否影响到外围', async ({ content, room, isThemeRoom }) => {
1515

16-
test.skip(await room.isThemePage(), '此測試不適用於大海報房間')
16+
test.skip(isThemeRoom, '此測試不適用於大海報房間')
1717

1818
logger.info('正在測試 CSS 有否外溢...')
1919

‎tests/features/jimaku.spec.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ test('測試功能元素是否存在', async ({ content: p }) => {
1717

1818
})
1919

20-
test('測試字幕區塊是否存在', async ({ content: p, isThemeRoom }) => {
20+
test('測試字幕區塊是否存在', { tag: "@scoped" }, async ({ content: p, isThemeRoom }) => {
2121

2222
test.skip(isThemeRoom, '此測試不適用於大海報房間')
2323

@@ -73,7 +73,7 @@ test('測試字幕按鈕 (刪除/下載)', async ({ room, content: p, page }) =>
7373
})
7474

7575

76-
test('測試彈出同傳視窗', async ({ room, context, tabUrl, page, content }) => {
76+
test('測試彈出同傳視窗', { tag: "@scoped" }, async ({ room, context, tabUrl, page, content }) => {
7777
// modify settings
7878
logger.info('正在修改設定...')
7979
const settingsPage = await context.newPage()
@@ -308,9 +308,9 @@ test('測試右鍵同傳字幕來屏蔽同傳發送者', async ({ content, room,
308308

309309
})
310310

311-
test('測試全屏時字幕區塊是否存在 + 顯示切換', async ({ content: p, room }) => {
311+
test('測試全屏時字幕區塊是否存在 + 顯示切換', async ({ content: p, room, isThemeRoom }) => {
312312

313-
test.skip(await room.isThemePage(), '此測試不適用於大海報房間')
313+
test.skip(isThemeRoom, '此測試不適用於大海報房間')
314314

315315
const area = p.locator('#jimaku-area div#subtitle-list')
316316
await expect(area).toBeAttached()

‎tests/features/superchat.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ test('測試寫入醒目留言和醒目留言按鈕 (插入/刪除/下載)', asy
8484
expect(superchatList.length).toBe(0)
8585
})
8686

87-
test('測試拖拽按鈕', async ({ content }) => {
87+
test('測試拖拽按鈕', { tag: "@scoped" }, async ({ content }) => {
8888

8989
const dragPoint = content.locator('bjf-csui section#bjf-feature-superchat > div > div')
9090
const p1 = content.locator('#rank-list-ctnr-box')

0 commit comments

Comments
 (0)
Please sign in to comment.