Skip to content

Commit

Permalink
fixup! trying to fix test failed
Browse files Browse the repository at this point in the history
  • Loading branch information
eric2788 committed Mar 12, 2024
1 parent 0c71767 commit cca9075
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/components/DraggableFloatingButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ function DraggableFloatingButton(props: DraggableFloatingButtonProps): JSX.Eleme
height: 25,
}}
>
<div className="w-full h-full rounded-full bg-white flex justify-center items-center">
<div playwright-test="draggable" className="w-full h-full rounded-full bg-white flex justify-center items-center">
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlnsXlink="http://www.w3.org/1999/xlink" x={0} y={0}
viewBox="0 0 18 18" enableBackground="new 0 0 18 18" xmlSpace="preserve">
<path fill="#ffffff" d="M9,1L1,9l5.2,5.2L9,17l8-8L9,1z M7,12H6v-1h1V12z M7,7H6V6h1V7z M12,12h-1v-1h1V12z M11,6h1v1h-1V6z" />
Expand Down
6 changes: 3 additions & 3 deletions src/features/superchat/components/SuperChatFloatingButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { Fragment, useContext } from 'react';
import DraggableFloatingButton from '~components/DraggableFloatingButton';
import BJFThemeDarkContext from '~contexts/BLiveThemeDarkContext';
import SuperChatFeatureContext from '~contexts/SuperChatFeatureContext';
import TailwindScope from '~components/TailwindScope';

export type SuperChatFloatingButtonProps = {
children: React.ReactNode
Expand All @@ -20,7 +19,8 @@ function SuperChatFloatingButton({ children }: SuperChatFloatingButtonProps): JS
})

return (
<TailwindScope styles={[styleText]}>
<Fragment>
<style>{styleText}</style>
<DraggableFloatingButton style={{ backgroundColor: themeDark ? '#424242' : floatingButtonColor }} onClick={e => show({ event: e })} className='hover:brightness-90 duration-150 dark:bg-gray-700 dark:hover:bg-gray-800 text-white'>
<div className="group-hover:animate-pulse">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" strokeWidth={1.5} stroke="currentColor" className="w-10 h-10">
Expand All @@ -33,7 +33,7 @@ function SuperChatFloatingButton({ children }: SuperChatFloatingButtonProps): JS
<Item className='hidden'>{''}</Item>
{children}
</Menu>
</TailwindScope>
</Fragment>
)
}

Expand Down
4 changes: 2 additions & 2 deletions tests/features/jimaku.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ test('測試功能元素是否存在', async ({ content: p }) => {

})

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

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

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


test('測試彈出同傳視窗', { tag: "@scoped" }, async ({ room, context, tabUrl, page, content }) => {
test('測試彈出同傳視窗', async ({ room, context, tabUrl, page, content }) => {
// modify settings
logger.info('正在修改設定...')
const settingsPage = await context.newPage()
Expand Down
2 changes: 1 addition & 1 deletion tests/features/superchat.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ test('測試寫入醒目留言和醒目留言按鈕 (插入/刪除/下載)', asy

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

const dragPoint = content.locator('bjf-csui section#bjf-feature-superchat > div > div')
const dragPoint = content.locator('bjf-csui section#bjf-feature-superchat [playwright-test="draggable"]')
const p1 = content.locator('#rank-list-ctnr-box')
const p2 = content.locator('#head-info-vm')

Expand Down

0 comments on commit cca9075

Please sign in to comment.