Skip to content

Commit f49b0af

Browse files
authored
Fix E2E tests (#4044)
1 parent 3d8e89c commit f49b0af

13 files changed

Lines changed: 24 additions & 15 deletions

File tree

packages/gitbook/e2e/internal.spec.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ const searchTestCases: Test[] = [
149149
mode: CustomizationAIMode.Assistant,
150150
},
151151
}),
152+
screenshot: false,
152153
run: async (page) => {
153154
await waitForCookiesDialog(page);
154155
const searchInput = page.locator('css=[data-testid="search-input"]');
@@ -185,6 +186,7 @@ const searchTestCases: Test[] = [
185186
mode: CustomizationAIMode.Assistant,
186187
},
187188
}),
189+
screenshot: false,
188190
run: async (page) => {
189191
await waitForCookiesDialog(page);
190192
await page.keyboard.press('ControlOrMeta+I');
@@ -218,6 +220,7 @@ const searchTestCases: Test[] = [
218220
mode: CustomizationAIMode.Assistant,
219221
},
220222
})}&ask=`,
223+
screenshot: false,
221224
run: async (page) => {
222225
await waitForCookiesDialog(page);
223226
await expect(page.getByTestId('search-input')).not.toBeFocused();
@@ -235,6 +238,7 @@ const searchTestCases: Test[] = [
235238
mode: CustomizationAIMode.Assistant,
236239
},
237240
})}&ask=${encodeURIComponent(AI_PROMPT)}`,
241+
screenshot: false,
238242
run: async (page) => {
239243
await waitForCookiesDialog(page);
240244
await expect(page.getByTestId('search-input')).not.toBeFocused();

packages/gitbook/src/components/Ads/AdCoverRendering.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ export async function AdCoverRendering({
7777
'shadow-md',
7878
'max-h-32',
7979
'group-hover/ad:max-h-16',
80-
'motion-safe:transition-all'
80+
'transition-all',
81+
'motion-reduce:transition-none'
8182
)}
8283
/>
8384
</div>
@@ -93,7 +94,8 @@ export async function AdCoverRendering({
9394
'opacity-0',
9495
'group-hover/ad:h-16',
9596
'group-hover/ad:opacity-10',
96-
'motion-safe:transition-all'
97+
'transition-all',
98+
'motion-reduce:transition-none'
9799
)}
98100
>
99101
{ad.description}

packages/gitbook/src/components/Announcement/AnnouncementBanner.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export function AnnouncementBanner(props: {
3434
className="theme-bold:bg-header-background pt-4 pb-2"
3535
data-nosnippet=""
3636
>
37-
<div className="transition-all duration-300 lg:chat-open:pr-80 xl:chat-open:pr-96">
37+
<div className="transition-all duration-300 motion-reduce:transition-none lg:chat-open:pr-80 xl:chat-open:pr-96">
3838
<div className={tcls('relative', CONTAINER_STYLE)}>
3939
<Tag
4040
href={contentRef?.href ?? ''}

packages/gitbook/src/components/Cookies/CookiesToast.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ export function CookiesToast(props: { privacyPolicy?: string }) {
8282
'sm:left-auto',
8383
'lg:chat-open:mr-80',
8484
'xl:chat-open:mr-100',
85-
'motion-safe:transition-all',
85+
'transition-all',
86+
'motion-reduce:transition-none',
8687
'duration-300',
8788
'text-sm'
8889
)}

packages/gitbook/src/components/Embeddable/EmbeddableFrame.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ export function EmbeddableFrameSidebar(props: { children: React.ReactNode }) {
120120
const { children } = props;
121121

122122
return (
123-
<div className="flex w-15 shrink-0 origin-top not-hydrated:animate-blur-in-slow flex-col gap-2 overflow-hidden border-tint-solid/3 border-r bg-tint-solid/1 p-2 transition-all transition-discrete duration-300 empty:hidden empty:w-0 empty:px-0">
123+
<div className="flex w-15 shrink-0 origin-top not-hydrated:animate-blur-in-slow flex-col gap-2 overflow-hidden border-tint-solid/3 border-r bg-tint-solid/1 p-2 transition-all transition-discrete duration-300 empty:hidden empty:w-0 empty:px-0 motion-reduce:transition-none">
124124
{children}
125125
</div>
126126
);

packages/gitbook/src/components/Footer/Footer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export function Footer(props: { context: GitBookSiteContext }) {
3535
mobileOnly ? 'xl:hidden' : null
3636
)}
3737
>
38-
<div className="motion-safe:transition-[padding] motion-safe:duration-300 lg:chat-open:pr-80 xl:chat-open:pr-96">
38+
<div className="transition-[padding] duration-300 motion-reduce:transition-none lg:chat-open:pr-80 xl:chat-open:pr-96">
3939
<div
4040
className={tcls(
4141
CONTAINER_STYLE,

packages/gitbook/src/components/Header/Header.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export function Header(props: {
6868
'site-header:theme-bold:shadow-tint-12/2'
6969
)}
7070
>
71-
<div className="transition-all duration-300 lg:chat-open:pr-80 xl:chat-open:pr-96">
71+
<div className="transition-all duration-300 motion-reduce:transition-none lg:chat-open:pr-80 xl:chat-open:pr-96">
7272
<div
7373
data-gb-header-content
7474
className={tcls(
@@ -82,7 +82,7 @@ export function Header(props: {
8282
'min-h-16',
8383
'sm:h-16',
8484
CONTAINER_STYLE,
85-
'transition-[max-width] duration-300',
85+
'transition-[max-width] duration-300 motion-reduce:transition-none',
8686
'@container/header'
8787
)}
8888
>
@@ -120,7 +120,7 @@ export function Header(props: {
120120
'justify-self-end',
121121
'items-center',
122122
'gap-2',
123-
'transition-[margin] duration-300',
123+
'transition-[margin] duration-300 motion-reduce:transition-none',
124124
'search' in customization.styling &&
125125
customization.styling.search === 'prominent'
126126
? [
@@ -201,7 +201,7 @@ export function Header(props: {
201201
</div>
202202

203203
{visibleSections && withSections ? (
204-
<div className="transition-[padding] duration-300 lg:chat-open:pr-80 xl:chat-open:pr-96">
204+
<div className="transition-[padding] duration-300 motion-reduce:transition-none lg:chat-open:pr-80 xl:chat-open:pr-96">
205205
<SiteSectionTabs sections={encodeClientSiteSections(context, visibleSections)}>
206206
{variants.translations.length > 1 ? (
207207
<TranslationsDropdown

packages/gitbook/src/components/PDF/ImagesLoadingStatus.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export function ImagesLoadingStatus(props: {
1111
const { language } = props;
1212
const state = useImagesLoadingState();
1313
return (
14-
<p className="text-right text-slate-500 text-xs">
14+
<p className="text-right text-slate-500 text-xs" data-visual-test="removed">
1515
{(() => {
1616
switch (state.status) {
1717
case 'pending':

packages/gitbook/src/components/PageAside/PageAside.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export function PageAside(props: {
5959
'hydrated:starting:max-w-0',
6060
'hydrated:starting:opacity-0',
6161

62-
'transition-[margin,max-width,opacity,display] duration-300',
62+
'transition-[margin,max-width,opacity,display] duration-300 motion-reduce:transition-none',
6363
'transition-discrete',
6464

6565
'basis-56',

packages/gitbook/src/components/PageAside/ScrollSectionsList.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ export function ScrollSectionsList({ sections }: { sections: DocumentSection[] }
7373
'px-3',
7474

7575
'transition-all',
76+
'motion-reduce:transition-none',
7677
'duration-200',
7778

7879
'rounded-md',

0 commit comments

Comments
 (0)