chore: add e2e test for ai translation (#18061)
* make createNewEventType receive description arg * remove @test tag * wip * wip2 * remove @test tag * modify EventMetaProps * add test id event-meta-description * improve test * better name * try * finalized * fix * fix type check * address comment * cleann up * cleann up * fix * Update ai-translation.e2e.ts * fix * simplify --------- Co-authored-by: Keith Williams <[email protected]>
This commit is contained in:
1 parent
866a0e2596
commit
5dd4937a1a
9 files changed
+106
-44
No files matched your search
@@ -168,7 +168,9 @@ export const EventMeta = ({
|
||||
{translatedTitle ?? event?.title}
|
||||
</EventTitle>
|
||||
{(event.description || translatedDescription) && (
|
||||
<EventMetaBlock contentClassName="mb-8 break-words max-w-full max-h-[180px] scroll-bar pr-4">
|
||||
<EventMetaBlock
|
||||
data-testid="event-meta-description"
|
||||
contentClassName="mb-8 break-words max-w-full max-h-[180px] scroll-bar pr-4">
|
||||
<div
|
||||
// eslint-disable-next-line react/no-danger
|
||||
dangerouslySetInnerHTML={{
|
||||
|
||||
@@ -43,16 +43,14 @@ type EventDetailCustomBlock = {
|
||||
|
||||
type EventDetailsProps = EventDetailsPropsBase & (EventDetailDefaultBlock | EventDetailCustomBlock);
|
||||
|
||||
interface EventMetaProps {
|
||||
interface EventMetaProps extends React.HTMLAttributes<HTMLDivElement> {
|
||||
customIcon?: React.ReactNode;
|
||||
icon?: IconName;
|
||||
iconUrl?: string;
|
||||
children: React.ReactNode;
|
||||
// Emphasises the text in the block. For now only
|
||||
// applying in dark mode.
|
||||
highlight?: boolean;
|
||||
contentClassName?: string;
|
||||
className?: string;
|
||||
isDark?: boolean;
|
||||
}
|
||||
|
||||
@@ -80,6 +78,7 @@ export const EventMetaBlock = ({
|
||||
contentClassName,
|
||||
className,
|
||||
isDark,
|
||||
...rest
|
||||
}: EventMetaProps) => {
|
||||
if (!React.Children.count(children)) return null;
|
||||
|
||||
@@ -89,7 +88,8 @@ export const EventMetaBlock = ({
|
||||
"flex items-start justify-start text-sm",
|
||||
highlight ? "text-emphasis" : "text-text",
|
||||
className
|
||||
)}>
|
||||
)}
|
||||
{...rest}>
|
||||
{iconUrl ? (
|
||||
<img
|
||||
src={iconUrl}
|
||||
|
||||
@@ -170,6 +170,7 @@ export const EventSetupTab = (
|
||||
}}
|
||||
disabled={!orgId}
|
||||
tooltip={!orgId ? t("orgs_upgrade_to_enable_feature") : undefined}
|
||||
data-testid="ai_translation_toggle"
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
|
||||
Reference in new issue
Block a user