chore: add testid for debug
Signed-off-by: Innei <i@innei.in>
This commit is contained in:
parent
ea6fbc27e6
commit
5104ad1964
|
|
@ -187,7 +187,11 @@ export function DiscoverForm({ type }: { type: string }) {
|
|||
return (
|
||||
<>
|
||||
<Form {...form}>
|
||||
<form onSubmit={form.handleSubmit(onSubmit)} className="w-[512px] space-y-8">
|
||||
<form
|
||||
onSubmit={form.handleSubmit(onSubmit)}
|
||||
className="w-[512px] space-y-8"
|
||||
data-testid="discover-form"
|
||||
>
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="keyword"
|
||||
|
|
@ -225,7 +229,7 @@ export function DiscoverForm({ type }: { type: string }) {
|
|||
)}
|
||||
/>
|
||||
)}
|
||||
<div className="center flex">
|
||||
<div className="center flex" data-testid="discover-form-actions">
|
||||
<Button disabled={!form.formState.isValid} type="submit" isLoading={mutation.isPending}>
|
||||
{info[type].showModal ? t("discover.preview") : t("words.search")}
|
||||
</Button>
|
||||
|
|
|
|||
|
|
@ -212,6 +212,7 @@ export const EntryContentRender: Component<{ entryId: string }> = ({ entryId, cl
|
|||
key={entry.entries.id}
|
||||
>
|
||||
<article
|
||||
data-testid="entry-render"
|
||||
onContextMenu={stopPropagation}
|
||||
className="relative m-auto min-w-0 max-w-[550px] @3xl:max-w-[70ch]"
|
||||
>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import { registerGlobalContext } from "@follow/shared/bridge"
|
||||
import { env } from "@follow/shared/env"
|
||||
import { useEffect, useLayoutEffect } from "react"
|
||||
import { useTranslation } from "react-i18next"
|
||||
import { toast } from "sonner"
|
||||
|
|
@ -28,6 +29,12 @@ export const ExtensionExposeProvider = () => {
|
|||
},
|
||||
|
||||
toast,
|
||||
getApiUrl() {
|
||||
return env.VITE_API_URL
|
||||
},
|
||||
getWebUrl() {
|
||||
return window.location.origin
|
||||
},
|
||||
})
|
||||
}, [])
|
||||
|
||||
|
|
|
|||
|
|
@ -25,6 +25,9 @@ interface RenderGlobalContext {
|
|||
|
||||
/// Utils
|
||||
toast: typeof toast
|
||||
// URL
|
||||
getWebUrl: () => string
|
||||
getApiUrl: () => string
|
||||
}
|
||||
|
||||
export const registerGlobalContext = (context: Partial<RenderGlobalContext>) => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue