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