Skip to content

A full-featured CRM built with React, shadcn/ui, and Supabase.

fix test after rebase

ThieryMichel7aa46a36a49b
diff --git a/e2e/fixtures.ts b/e2e/fixtures.ts
index 6464c872..c7fbdc5e 100644
--- a/e2e/fixtures.ts
+++ b/e2e/fixtures.ts
@@ -120,10 +120,16 @@ async function createNotes({
}
}
-async function createCompany({ name }: { name: string }) {
+async function createCompany({
+ name,
+ salesId,
+}: {
+ name: string;
+ salesId: string | number;
+}) {
const { data, error } = await adminSupabase
.from("companies")
- .insert({ name })
+ .insert({ name, sales_id: salesId })
.select("id")
.single();
@@ -187,17 +193,9 @@ async function createContact({
return data;
}
-const getMenuMethod = ({
- page,
- isMobile,
-}: {
- page: any;
- isMobile: boolean;
-}) => ({
+const getMenuMethod = ({ page }: { page: any; isMobile: boolean }) => ({
goToDashboard: async () => {
- await page
- .getByRole("link", { name: isMobile ? "Home" : "Dashboard" })
- .click();
+ await page.getByRole("link", { name: "Dashboard" }).click();
await page.waitForLoadState("networkidle");
},
goToContacts: async () => {
diff --git a/e2e/onboarding.spec.ts b/e2e/onboarding.spec.ts
index dce3932f..053b8482 100644
--- a/e2e/onboarding.spec.ts
+++ b/e2e/onboarding.spec.ts
@@ -26,7 +26,7 @@ test("user onboarding", async ({ page, isMobile, menu }) => {
await page.getByLabel("Last name").fill("Smith");
await page.getByLabel("Title").fill("CEO");
await page.getByLabel("Company").click();
- await page.getByPlaceholder("Search...").fill("Smith Corp");
+ await page.getByPlaceholder("Search").fill("Smith Corp");
await page.getByText("Create Smith Corp").click();
await page
.getByRole("group", { name: "Email addresses" })
@@ -80,10 +80,11 @@ test("user onboarding", async ({ page, isMobile, menu }) => {
.click();
await expect(page.getByText("Element created")).toBeVisible();
+ await expect(page.getByText("Element created")).toBeHidden();
await page.waitForLoadState("networkidle");
await expect(
- page.getByText(isMobile ? "By you" : "You added a note"),
+ page.getByText(isMobile ? "Me" : "You added a note", { exact: false }),
).toBeVisible();
await expect(page.getByText("This is a note about Jane.")).toBeVisible();
diff --git a/e2e/userAddingATask.spec.ts b/e2e/userAddingATask.spec.ts
index 74ec7081..8099aa9c 100644
--- a/e2e/userAddingATask.spec.ts
+++ b/e2e/userAddingATask.spec.ts
@@ -11,6 +11,7 @@ test.describe("user adding a task", () => {
const company = await createCompany({
name: "Smith Corp",
+ salesId: sales.id,
});
await createContact({
@@ -75,8 +76,8 @@ test.describe("user adding a task", () => {
).not.toBeVisible();
if (isMobile) {
- await expect(page.getByText("1 Tasks")).toBeVisible();
- await page.getByText("1 Tasks").click();
+ await expect(page.getByText("1 task")).toBeVisible();
+ await page.getByText("1 task").click();
await expect(page.getByText("Follow up with Jane")).toBeVisible();
await expect(page.getByText("due 4/11/2026, 9:00:00 PM")).toBeVisible();
diff --git a/makefile b/makefile
index a033ecea..0e839fad 100644
--- a/makefile
+++ b/makefile
@@ -46,6 +46,7 @@ start-supabase-e2e: ## start a separate supabase instance for e2e (fresh DB ever
mkdir -p .supabase-e2e/supabase
cp supabase/config.e2e.toml .supabase-e2e/supabase/config.toml
cp -r supabase/migrations .supabase-e2e/supabase/migrations
+ cp -r supabase/schemas .supabase-e2e/supabase/schemas
cp -r supabase/functions .supabase-e2e/supabase/functions
cp -r supabase/templates .supabase-e2e/supabase/templates
cp supabase/seed.sql .supabase-e2e/supabase/seed.sql
diff --git a/src/components/atomic-crm/sales/useGetSalesName.ts b/src/components/atomic-crm/sales/useGetSalesName.ts
index 828ad3c0..27b5dc88 100644
--- a/src/components/atomic-crm/sales/useGetSalesName.ts
+++ b/src/components/atomic-crm/sales/useGetSalesName.ts
@@ -11,6 +11,7 @@ export const useGetSalesName = (
{ ids: id !== null ? [id] : undefined },
{ enabled },
);
+
return data
? `${data[0].first_name} ${data[0].last_name}`
: error
diff --git a/supabase/config.e2e.toml b/supabase/config.e2e.toml
index 3aee3a1b..0baa1c8d 100644
--- a/supabase/config.e2e.toml
+++ b/supabase/config.e2e.toml
@@ -39,6 +39,10 @@ max_client_conn = 100
[realtime]
enabled = true
+# Bind realtime via either IPv4 or IPv6. (default: IPv6)
+# ip_version = "IPv6"
+# The maximum length in bytes of HTTP request headers. (default: 4096)
+# max_header_length = 4096
[studio]
enabled = true
@@ -47,10 +51,15 @@ port = 54343
# External URL of the API server that frontend connects to.
api_url = "http://127.0.0.1"
+# Email testing server. Emails sent with the local dev setup are not actually sent - rather, they
+# are monitored, and you can view the emails that would have been sent from the web interface.
[inbucket]
enabled = true
# Port to use for the email testing server web interface.
port = 54344
+# Uncomment to expose additional ports for testing user applications that send emails.
+# smtp_port = 54325
+# pop3_port = 54326
[storage]
enabled = true
@@ -101,33 +110,50 @@ enable_confirmations = false
# Template for sending OTP to users
template = "Your code is {{ .Code }} ."
+# Use pre-defined map of phone number to OTP for testing.
[auth.sms.test_otp]
# 4152127777 = "123456"
+# Configure one of the supported SMS providers: `twilio`, `twilio_verify`, `messagebird`, `textlocal`, `vonage`.
[auth.sms.twilio]
enabled = false
account_sid = ""
message_service_sid = ""
+# DO NOT commit your Twilio auth token to git. Use environment variable substitution instead:
auth_token = "env(SUPABASE_AUTH_SMS_TWILIO_AUTH_TOKEN)"
+# Use an external OAuth provider. The full list of providers are: `apple`, `azure`, `bitbucket`,
+# `discord`, `facebook`, `github`, `gitlab`, `google`, `keycloak`, `linkedin`, `notion`, `twitch`,
+# `twitter`, `slack`, `spotify`, `workos`, `zoom`.
[auth.external.apple]
enabled = false
client_id = ""
+# DO NOT commit your OAuth provider secret to git. Use environment variable substitution instead:
secret = "env(SUPABASE_AUTH_EXTERNAL_APPLE_SECRET)"
+# Overrides the default auth redirectUrl.
redirect_uri = ""
+# Overrides the default auth provider URL. Used to support self-hosted gitlab, single-tenant Azure,
+# or any other third-party OIDC providers.
url = ""
[analytics]
enabled = false
port = 54347
vector_port = 54348
+# Configure one of the supported backends: `postgres`, `bigquery`.
backend = "postgres"
+# Experimental features may be deprecated any time
[experimental]
+# Configures Postgres storage engine to use OrioleDB (S3)
orioledb_version = ""
+# Configures S3 bucket URL, eg. <bucket_name>.s3-<region>.amazonaws.com
s3_host = "env(S3_HOST)"
+# Configures S3 bucket region, eg. us-east-1
s3_region = "env(S3_REGION)"
+# Configures AWS_ACCESS_KEY_ID for S3 bucket
s3_access_key = "env(S3_ACCESS_KEY)"
+# Configures AWS_SECRET_ACCESS_KEY for S3 bucket
s3_secret_key = "env(S3_SECRET_KEY)"
[functions.merge_contacts]