Skip to content

Commit 4b17060

Browse files
committed
feat(e2e): skip OAuth overlay tests on mobile due to MobileGate interference
- Updated OAuth overlay tests to skip execution on mobile devices, as the MobileGate component prevents the overlay from rendering. - Simplified the test for blurring the active element by removing mobile-specific conditions, ensuring consistent behavior across devices. - Enhanced MobileGate component styling using Tailwind CSS for improved responsiveness and visual consistency.
1 parent f7ff420 commit 4b17060

File tree

2 files changed

+34
-92
lines changed

2 files changed

+34
-92
lines changed

e2e/oauth/oauth-overlay.spec.ts

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,17 @@ import {
2222
* The overlay shows two phases:
2323
* 1. OAuth phase: "Complete Google sign-in..." - when isSyncing=true, importing=false
2424
* 2. Import phase: "Importing your Google Calendar..." - when importing=true
25+
*
26+
* NOTE: These tests are skipped on mobile because the MobileGate component
27+
* blocks the entire app on mobile viewports, preventing the OAuth overlay
28+
* from ever being rendered. This is intentional product behavior.
2529
*/
2630
test.describe("OAuth Overlay", () => {
31+
// Skip on mobile - MobileGate blocks the app, so OAuth overlay never renders
32+
test.skip(
33+
({ isMobile }) => isMobile,
34+
"OAuth overlay not available on mobile",
35+
);
2736
test.beforeEach(async ({ page }) => {
2837
await prepareOAuthTestPage(page);
2938
await page.goto("/");
@@ -89,25 +98,11 @@ test.describe("OAuth Overlay", () => {
8998
await expectBodyLocked(page, false);
9099
});
91100

92-
test("blurs active element when overlay activates", async ({
93-
page,
94-
isMobile,
95-
}) => {
96-
// On mobile, the main grid might not be visible - use a different focusable element
97-
// or skip for mobile as the blur behavior is the same regardless of viewport
98-
if (isMobile) {
99-
// On mobile, find any focusable element that's visible
100-
const focusable = page
101-
.locator("button:visible, [tabindex]:visible")
102-
.first();
103-
await focusable.waitFor({ state: "visible", timeout: 10000 });
104-
await focusable.focus();
105-
} else {
106-
// Wait for main grid to be visible and focusable on desktop
107-
const mainGrid = page.locator("#mainGrid");
108-
await mainGrid.waitFor({ state: "visible", timeout: 10000 });
109-
await mainGrid.focus();
110-
}
101+
test("blurs active element when overlay activates", async ({ page }) => {
102+
// Wait for main grid to be visible and focusable
103+
const mainGrid = page.locator("#mainGrid");
104+
await mainGrid.waitFor({ state: "visible", timeout: 10000 });
105+
await mainGrid.focus();
111106

112107
await page.waitForTimeout(100); // Give time for focus to settle
113108

@@ -201,6 +196,12 @@ test.describe("OAuth Overlay", () => {
201196
});
202197

203198
test.describe("OAuth Overlay - Edge Cases", () => {
199+
// Skip on mobile - MobileGate blocks the app, so OAuth overlay never renders
200+
test.skip(
201+
({ isMobile }) => isMobile,
202+
"OAuth overlay not available on mobile",
203+
);
204+
204205
test.beforeEach(async ({ page }) => {
205206
await prepareOAuthTestPage(page);
206207
await page.goto("/");
Lines changed: 14 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -1,88 +1,29 @@
11
import React from "react";
2-
import styled from "styled-components";
32

43
const WAITLIST_URL = "https://tylerdane.kit.com/compass-mobile";
54

6-
const Container = styled.div`
7-
display: flex;
8-
justify-content: center;
9-
align-items: center;
10-
min-height: 100vh;
11-
min-height: 100dvh;
12-
background-color: ${({ theme }) => theme.color.bg.primary};
13-
padding: ${({ theme }) => theme.spacing.m};
14-
`;
15-
16-
const Card = styled.div`
17-
background-color: ${({ theme }) => theme.color.bg.secondary};
18-
border: 1px solid ${({ theme }) => theme.color.border.primary};
19-
border-radius: ${({ theme }) => theme.shape.borderRadius};
20-
padding: ${({ theme }) => theme.spacing.xl};
21-
width: 400px;
22-
max-width: 90vw;
23-
display: flex;
24-
flex-direction: column;
25-
align-items: center;
26-
text-align: center;
27-
`;
28-
29-
const Title = styled.h1`
30-
font-family: "Rubik", sans-serif;
31-
font-size: 24px;
32-
font-weight: 500;
33-
color: ${({ theme }) => theme.color.common.white};
34-
margin: 0 0 ${({ theme }) => theme.spacing.l};
35-
`;
36-
37-
const Message = styled.p`
38-
font-family: "Rubik", sans-serif;
39-
font-size: 16px;
40-
font-weight: 400;
41-
color: #a0a0a0;
42-
margin: 0 0 ${({ theme }) => theme.spacing.xl};
43-
line-height: 1.6;
44-
`;
45-
46-
const WaitlistButton = styled.button`
47-
font-family: "Rubik", sans-serif;
48-
font-size: 16px;
49-
font-weight: 500;
50-
min-height: 44px;
51-
padding: ${({ theme }) => theme.spacing.s} ${({ theme }) => theme.spacing.xl};
52-
background-color: ${({ theme }) => theme.color.text.accent};
53-
color: ${({ theme }) => theme.color.common.white};
54-
border: none;
55-
border-radius: ${({ theme }) => theme.shape.borderRadius};
56-
cursor: pointer;
57-
transition: opacity ${({ theme }) => theme.transition.default};
58-
59-
&:hover {
60-
opacity: 0.9;
61-
}
62-
63-
&:focus {
64-
outline: 2px solid ${({ theme }) => theme.color.text.accent};
65-
outline-offset: 2px;
66-
}
67-
`;
68-
695
export const MobileGate: React.FC = () => {
706
const handleJoinWaitlist = () => {
717
window.open(WAITLIST_URL, "_blank", "noopener,noreferrer");
728
};
739

7410
return (
75-
<Container>
76-
<Card>
77-
<Title>Compass isn&apos;t built for mobile yet</Title>
78-
<Message>
11+
<div className="bg-bg-primary flex min-h-dvh items-center justify-center p-4">
12+
<div className="border-border-primary bg-bg-secondary flex w-[400px] max-w-[90vw] flex-col items-center rounded border p-8 text-center">
13+
<h1 className="mb-6 font-sans text-2xl font-medium text-white">
14+
Compass isn&apos;t built for mobile yet
15+
</h1>
16+
<p className="text-text-light-inactive mb-8 font-sans text-base leading-relaxed">
7917
We&apos;re focusing on perfecting the web experience first. Join our
8018
mobile waitlist to be the first to know when we launch.
81-
</Message>
82-
<WaitlistButton onClick={handleJoinWaitlist}>
19+
</p>
20+
<button
21+
onClick={handleJoinWaitlist}
22+
className="bg-accent-primary focus:outline-accent-primary min-h-[44px] cursor-pointer rounded border-none px-8 py-2 font-sans text-base font-medium text-white transition-opacity duration-300 hover:opacity-90 focus:outline focus:outline-2 focus:outline-offset-2"
23+
>
8324
Join Mobile Waitlist
84-
</WaitlistButton>
85-
</Card>
86-
</Container>
25+
</button>
26+
</div>
27+
</div>
8728
);
8829
};

0 commit comments

Comments
 (0)