@ -9,7 +9,7 @@
|
||||
"start": "next start",
|
||||
"lint": "next lint",
|
||||
"test": "pnpm playwright test",
|
||||
"test:report": "pnpm playwright show-report"
|
||||
"test:show-report": "pnpm playwright show-report src/test/reporters"
|
||||
},
|
||||
"dependencies": {
|
||||
"@chakra-ui/anatomy": "^2.1.1",
|
||||
|
@ -1,4 +1,4 @@
|
||||
import React from 'react'
|
||||
import React, { useEffect } from 'react'
|
||||
import { ButtonProps, Button, useClipboard } from '@chakra-ui/react'
|
||||
|
||||
interface CopyButtonProps extends ButtonProps {
|
||||
@ -8,7 +8,11 @@ interface CopyButtonProps extends ButtonProps {
|
||||
|
||||
export const CopyButton = (props: CopyButtonProps) => {
|
||||
const { textToCopy, onCopied, ...buttonProps } = props
|
||||
const { hasCopied, onCopy } = useClipboard(textToCopy)
|
||||
const { hasCopied, onCopy, setValue } = useClipboard(textToCopy)
|
||||
|
||||
useEffect(() => {
|
||||
setValue(textToCopy)
|
||||
}, [setValue, textToCopy])
|
||||
|
||||
return (
|
||||
<Button
|
||||
|
@ -63,7 +63,7 @@ export const EditableUrl = ({
|
||||
|
||||
<HStack>
|
||||
<EditButton size="xs" />
|
||||
<CopyButton size="xs" textToCopy={`${hostname}/${pathname ?? ''}`} />
|
||||
<CopyButton size="xs" textToCopy={`${hostname}/${value ?? ''}`} />
|
||||
</HStack>
|
||||
</Editable>
|
||||
)
|
||||
|
@ -22,7 +22,7 @@ if (fs.existsSync(localViewerEnvPath))
|
||||
|
||||
export const playwrightBaseConfig: PlaywrightTestConfig = {
|
||||
globalSetup: require.resolve(path.join(__dirname, 'globalSetup')),
|
||||
timeout: process.env.CI ? 50 * 1000 : 20 * 1000,
|
||||
timeout: process.env.CI ? 50 * 1000 : 40 * 1000,
|
||||
expect: {
|
||||
timeout: process.env.CI ? 10 * 1000 : 5 * 1000,
|
||||
},
|
||||
|
Reference in New Issue
Block a user