Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions e2e/integration/account-settings.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,14 @@ test.describe('account settings', () => {
});

test.describe('profile page', () => {
test('profile page renders its heading and coming-soon state', async ({ authedPage }) => {
test('profile page renders its heading and the public profile settings', async ({
authedPage,
}) => {
await authedPage.goto('/profile');
await authedPage.waitForLoadState('networkidle');
// The route is a placeholder today: a heading and an empty state, no user info of its own.
// Anything user-specific on the page would come from the surrounding shell, not the profile.
const main = authedPage.getByRole('main');
await expect(main.getByRole('heading', { name: /^profile$/i })).toBeVisible();
await expect(main.getByText(/profile is coming soon/i)).toBeVisible();
await expect(main.getByText(/make my profile public/i)).toBeVisible();
});
});

Expand Down
80 changes: 80 additions & 0 deletions e2e/integration/public-profiles.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
import { expect, test } from './lib/test-fixtures';

test.describe('public profiles and custom URLs', () => {
test('profile is private by default', async ({ browser, user }) => {
const anon = await browser.newContext();
const page = await anon.newPage();
await page.goto(`/u/${user.credentials.username}`);
await expect(page.getByText('Profile not found')).toBeVisible();
await anon.close();
});

test('custom URL, public profile and default public share', async ({
authedPage,
browser,
user,
}) => {
const username = user.credentials.username;
const page = authedPage;

// Create a public share with a custom URL
await page.goto('/shares/public');
await page.getByRole('main').getByRole('button', { name: 'New Share' }).first().click();
const dialog = page.getByRole('dialog');
await dialog.getByLabel('Name').fill('Profile Share');
await dialog.getByLabel('Custom URL').fill('Bad--Slug');
await expect(dialog.getByText(/use 2-32 lowercase letters/i)).toBeVisible();
await expect(dialog.getByRole('button', { name: 'Create' })).toBeDisabled();
await dialog.getByLabel('Custom URL').fill('Fun-Times');
await expect(dialog.getByText(`/u/${username}/fun-times`)).toBeVisible();
await dialog.getByRole('button', { name: 'Create' }).click();
await expect(page.getByText('Created new public share')).toBeVisible();
await expect(page.getByRole('main').locator('input[readonly]')).toHaveValue(
new RegExp(`/u/${username}/fun-times$`)
);

// Change the custom URL from the edit page
await page.getByRole('heading', { name: 'Profile Share' }).click();
await expect(page).toHaveURL(/\/shares\/public\/[0-9a-f-]+$/);
await page.goto(`${page.url()}/edit`);
const settings = page.locator('[data-slot="card"]', { hasText: 'Name, custom URL and expiry' });
await settings.getByLabel('Custom URL').fill('renamed');
await settings.getByRole('button', { name: 'Save Changes' }).click();
await expect(page.getByText('Public share updated')).toBeVisible();

// Make the profile public with pronouns, bio, a social and the default share
await page.goto('/profile');
await page.getByRole('switch', { name: /make my profile public/i }).click();
await page.getByRole('textbox', { name: 'Pronouns' }).fill('they/them');
await page.getByRole('textbox', { name: 'Bio' }).fill('Hello from the e2e suite');
await page.getByRole('button', { name: 'Add social' }).click();
await page.getByPlaceholder('https://example.com').fill('https://example.org/me');
await page.getByRole('combobox').filter({ hasText: 'None' }).click();
await page.getByRole('option', { name: 'Profile Share' }).click();
await page.getByRole('button', { name: 'Save Changes' }).click();
await expect(page.getByText('Profile saved')).toBeVisible();

// Visitors without an account see the profile, the default share and the custom URL
const anon = await browser.newContext();
const visitor = await anon.newPage();

await visitor.goto(`/u/${username}`);
await expect(visitor.getByText('Hello from the e2e suite')).toBeVisible();
await expect(visitor.getByText('they/them')).toBeVisible();
await expect(visitor.getByRole('link', { name: /example\.org\/me/ })).toHaveAttribute(
'href',
'https://example.org/me'
);
await expect(visitor.getByRole('heading', { name: 'Profile Share' })).toBeVisible();
await expect(visitor.getByRole('button', { name: 'Enter as Guest' })).toBeVisible();

await visitor.goto(`/u/${username}/renamed`);
await expect(visitor.getByRole('heading', { name: 'Profile Share' })).toBeVisible();
await expect(visitor.getByText('Hello from the e2e suite')).toBeVisible();

await visitor.goto(`/u/${username}/fun-times`);
await expect(visitor.getByText(/its custom URL has changed/i)).toBeVisible();

await anon.close();
});
});
84 changes: 84 additions & 0 deletions e2e/integration/public-share-password.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
import { expect, test } from './lib/test-fixtures';

test.describe('public share passwords', () => {
test('visitors unlock a password protected public share', async ({
authedPage,
browser,
user,
}) => {
const username = user.credentials.username;
const page = authedPage;

// Create a password protected public share
await page.goto('/shares/public');
await page.getByRole('main').getByRole('button', { name: 'New Share' }).first().click();
const dialog = page.getByRole('dialog');
await dialog.getByLabel('Name').fill('Locked Share');
await dialog.getByLabel('Custom URL').fill('locked');
await dialog.getByLabel('Password (optional)').fill('abc');
await expect(dialog.getByText('Use 4 to 128 characters.')).toBeVisible();
await expect(dialog.getByRole('button', { name: 'Create' })).toBeDisabled();
await dialog.getByLabel('Password (optional)').fill('open sesame');
await dialog.getByRole('button', { name: 'Create' }).click();
await expect(page.getByText('Created new public share')).toBeVisible();
await expect(page.getByLabel('Password protected')).toBeVisible();

// A visitor has to enter the password first
const anon = await browser.newContext();
const visitor = await anon.newPage();
await visitor.goto(`/u/${username}/locked`);
await expect(visitor.getByRole('heading', { name: 'Locked Share' })).toBeVisible();
await expect(visitor.getByText('This public share is password protected.')).toBeVisible();
await expect(visitor.getByRole('button', { name: 'Enter as Guest' })).toBeHidden();

await visitor.getByLabel('Password').fill('wrong password');
await visitor.getByRole('button', { name: 'Unlock' }).click();
await expect(visitor.getByText('Incorrect password')).toBeVisible();

await visitor.getByLabel('Password').fill('open sesame');
await visitor.getByRole('button', { name: 'Unlock' }).click();
await expect(visitor.getByRole('button', { name: 'Enter as Guest' })).toBeVisible();

// The unlock is remembered for the tab
await visitor.reload();
await expect(visitor.getByRole('button', { name: 'Enter as Guest' })).toBeVisible();

// Changing the password locks the visitor out again
await page.getByRole('heading', { name: 'Locked Share' }).click();
await expect(page).toHaveURL(/\/shares\/public\/[0-9a-f-]+$/);
await page.goto(`${page.url()}/edit`);
const passwordCard = page.locator('[data-slot="card"]', {
hasText: 'Visitors have to enter it',
});
await passwordCard.getByLabel('New password').fill('new secret');
await passwordCard.getByRole('button', { name: 'Change password' }).click();
await expect(page.getByText('Password saved')).toBeVisible();

await visitor.reload();
await expect(visitor.getByText('This public share is password protected.')).toBeVisible();

// Removing it opens the share
await passwordCard.getByRole('button', { name: 'Remove password' }).click();
await expect(page.getByText('Password removed')).toBeVisible();
await expect(passwordCard.getByText(/No password/)).toBeVisible();

await visitor.reload();
await expect(visitor.getByRole('button', { name: 'Enter as Guest' })).toBeVisible();

// Adding a password sends a visitor who is in control back to the password prompt
await visitor.getByRole('button', { name: 'Enter as Guest' }).click();
await visitor.getByPlaceholder('Guest Name').fill('Visitor');
await visitor.getByRole('button', { name: 'Enter', exact: true }).click();
await expect(visitor.getByText('This public share is password protected.')).toBeHidden();

await passwordCard.getByLabel('Password', { exact: true }).fill('another secret');
await passwordCard.getByRole('button', { name: 'Set password' }).click();
await expect(page.getByText('Password saved')).toBeVisible();

await expect(
visitor.getByText('The owner set a new password. Enter it to continue.')
).toBeVisible();

await anon.close();
});
});
17 changes: 17 additions & 0 deletions messages/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -1052,6 +1052,23 @@
"problem_share_link_not_found_title": "Öffentliche Freigabe nicht gefunden",
"problem_share_link_shocker_already_in_share_link_title": "Der Shocker ist bereits in dieser öffentlichen Freigabe",
"problem_share_link_shocker_not_in_share_link_title": "Der Shocker ist nicht in dieser öffentlichen Freigabe",
"problem_share_link_slug_invalid_title": "Ungültige benutzerdefinierte URL",
"problem_share_link_slug_invalid_desc": "Verwende 2–32 Kleinbuchstaben, Ziffern und einzelne Bindestriche, ohne Bindestrich am Anfang oder Ende.",
"problem_share_link_slug_taken_title": "Du hast bereits eine öffentliche Freigabe mit dieser benutzerdefinierten URL",
"problem_admin_email_provider_blacklist_invalid_domains_title": "Mindestens ein Eintrag ist keine gültige Domain, es wurde nichts hinzugefügt",
"problem_share_shocker_share_limit_reached_title": "Shocker hat zu viele Freigaben",
"problem_share_shocker_share_limit_reached_desc": "Ein Shocker kann mit höchstens 100 Nutzern geteilt werden.",
"problem_share_link_too_many_share_links_title": "Du hast zu viele öffentliche Freigaben",
"problem_share_link_too_many_share_links_desc": "Du hast das Maximum von 500 öffentlichen Freigaben erreicht.",
"problem_share_link_not_password_protected_title": "Diese öffentliche Freigabe hat kein Passwort",
"problem_share_link_password_incorrect_title": "Falsches Passwort",
"problem_share_link_too_many_password_attempts_title": "Zu viele falsche Passwörter",
"problem_share_link_too_many_password_attempts_desc": "Für diese öffentliche Freigabe wurden zu viele falsche Passwörter eingegeben. Versuche es in ein paar Minuten erneut.",
"problem_user_profile_not_found_title": "Profil nicht gefunden",
"problem_user_profile_default_public_share_not_found_title": "Standardmäßige öffentliche Freigabe nicht gefunden",
"problem_user_profile_default_public_share_not_found_desc": "Sie ist möglicherweise abgelaufen oder wurde gelöscht.",
"problem_user_profile_social_invalid_title": "Ungültiges soziales Netzwerk",
"problem_user_profile_social_invalid_desc": "Websites benötigen eine vollständige https://-URL, andere Netzwerke nur deinen Benutzernamen.",
"problem_shocker_control_no_permission_title": "Du darfst diesen Shocker nicht steuern",
"problem_shocker_control_not_found_title": "Shocker nicht gefunden",
"problem_shocker_control_paused_title": "Der Shocker ist pausiert",
Expand Down
72 changes: 72 additions & 0 deletions messages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -638,6 +638,37 @@
"profile_title": "Profile",
"profile_coming_soon": "Profile is coming soon",
"profile_coming_soon_desc": "Your public profile is not available yet. Account details live under Settings.",
"profile_subtitle": "Choose what people see on your profile and your public shares.",
"profile_load_failed": "Your profile could not be loaded.",
"profile_view": "View profile",
"profile_public_title": "Public profile",
"profile_public_desc": "Your profile is private until you turn this on.",
"profile_public_toggle": "Make my profile public",
"profile_public_on_hint": "Anyone can see your profile, and your public shares show your pronouns, bio and socials.",
"profile_public_off_hint": "Only you can see your profile. Your public shares still work through their links.",
"profile_about_title": "About you",
"profile_about_desc": "Shown on your profile and on your public shares.",
"profile_pronouns": "Pronouns",
"profile_pronouns_placeholder": "e.g. they/them",
"profile_too_long": "Must be {{max}} characters or fewer",
"profile_bio": "Bio",
"profile_bio_placeholder": "Tell people a bit about yourself",
"profile_socials": "Socials",
"profile_socials_desc": "Links to your other accounts, up to {{max}}.",
"profile_socials_add": "Add social",
"profile_socials_remove": "Remove social",
"profile_social_website": "Website",
"profile_social_invalid_website": "Enter a full URL starting with https://",
"profile_social_invalid_handle": "Enter just your username, without spaces or links",
"profile_default_share": "Default public share",
"profile_default_share_desc": "Shown on your profile page so visitors can use it right away.",
"profile_default_share_none": "None",
"profile_preview": "Preview",
"profile_toast_saved": "Profile saved",
"public_profile_not_found_title": "Profile not found",
"public_profile_not_found_desc": "This user does not exist or has not made their profile public.",
"public_profile_no_default_share": "{{name}} has not picked a public share to show here yet.",
"public_profile_share_failed": "The public share could not be loaded.",

"common_retry": "Retry",
"common_never_used": "Never used",
Expand Down Expand Up @@ -851,6 +882,30 @@
"public_share_view_enter": "Enter",
"public_share_view_enter_guest": "Enter as Guest",
"public_share_login": "Login",
"public_share_custom_url": "Custom URL",
"public_share_custom_url_optional": "Optional, lowercase letters, numbers and hyphens",
"public_share_slug_invalid": "Use 2-32 lowercase letters, numbers and single hyphens",
"public_share_slug_not_found_desc": "This public share does not exist, or its custom URL has changed.",
"public_share_password_title": "Password",
"public_share_password_settings_desc": "Visitors have to enter it before they can see or control the shockers. Setting or changing it disconnects everyone using this public share.",
"public_share_password_status_on": "Password protected",
"public_share_password_status_off": "No password, anyone with the link can use it",
"public_share_password_label": "Password",
"public_share_password_new": "New password",
"public_share_password_optional": "Password (optional)",
"public_share_password_set": "Set password",
"public_share_password_change": "Change password",
"public_share_password_remove": "Remove password",
"public_share_password_length": "Use {{min}} to {{max}} characters.",
"public_share_password_toast_set": "Password saved",
"public_share_password_toast_removed": "Password removed",
"public_share_password_desc": "This public share is password protected.",
"public_share_password_placeholder": "Enter the password",
"public_share_password_unlock": "Unlock",
"public_share_password_changed": "The owner set a new password. Enter it to continue.",
"public_share_settings_title": "Settings",
"public_share_settings_desc": "Name, custom URL and expiry of this public share.",
"public_share_toast_settings_saved": "Public share updated",
"perm_shock_on": "Shock enabled",
"perm_shock_off": "Shock disabled",
"perm_vibrate_on": "Vibrate enabled",
Expand Down Expand Up @@ -1099,6 +1154,23 @@
"problem_share_link_not_found_title": "Public share not found",
"problem_share_link_shocker_already_in_share_link_title": "Shocker is already in this public share",
"problem_share_link_shocker_not_in_share_link_title": "Shocker is not in this public share",
"problem_share_link_slug_invalid_title": "Invalid custom URL",
"problem_share_link_slug_invalid_desc": "Use 2-32 lowercase letters, numbers and single hyphens, not starting or ending with a hyphen.",
"problem_share_link_slug_taken_title": "You already have a public share with this custom URL",
"problem_admin_email_provider_blacklist_invalid_domains_title": "One or more entries are not valid domains, nothing was added",
"problem_share_shocker_share_limit_reached_title": "Shocker has too many shares",
"problem_share_shocker_share_limit_reached_desc": "A shocker can be shared with at most 100 users.",
"problem_share_link_too_many_share_links_title": "You have too many public shares",
"problem_share_link_too_many_share_links_desc": "You have reached the maximum of 500 public shares.",
"problem_share_link_not_password_protected_title": "This public share has no password",
"problem_share_link_password_incorrect_title": "Incorrect password",
"problem_share_link_too_many_password_attempts_title": "Too many incorrect passwords",
"problem_share_link_too_many_password_attempts_desc": "Too many incorrect passwords were entered for this public share. Try again in a few minutes.",
"problem_user_profile_not_found_title": "Profile not found",
"problem_user_profile_default_public_share_not_found_title": "Default public share not found",
"problem_user_profile_default_public_share_not_found_desc": "It may have expired or been deleted.",
"problem_user_profile_social_invalid_title": "Invalid social",
"problem_user_profile_social_invalid_desc": "Websites need a full https:// URL, other socials just your username.",
"problem_shocker_control_no_permission_title": "You do not have permission to control this shocker",
"problem_shocker_control_not_found_title": "Shocker not found",
"problem_shocker_control_paused_title": "Shocker is paused",
Expand Down
17 changes: 17 additions & 0 deletions messages/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -1052,6 +1052,23 @@
"problem_share_link_not_found_title": "No se encontró el enlace público",
"problem_share_link_shocker_already_in_share_link_title": "El shocker ya está en este enlace público",
"problem_share_link_shocker_not_in_share_link_title": "El shocker no está en este enlace público",
"problem_share_link_slug_invalid_title": "URL personalizada no válida",
"problem_share_link_slug_invalid_desc": "Usa de 2 a 32 letras minúsculas, números y guiones simples, sin empezar ni terminar con un guion.",
"problem_share_link_slug_taken_title": "Ya tienes un enlace público con esta URL personalizada",
"problem_admin_email_provider_blacklist_invalid_domains_title": "Una o más entradas no son dominios válidos, no se añadió nada",
"problem_share_shocker_share_limit_reached_title": "El shocker tiene demasiados accesos compartidos",
"problem_share_shocker_share_limit_reached_desc": "Un shocker se puede compartir con un máximo de 100 usuarios.",
"problem_share_link_too_many_share_links_title": "Tienes demasiados enlaces públicos",
"problem_share_link_too_many_share_links_desc": "Has alcanzado el máximo de 500 enlaces públicos.",
"problem_share_link_not_password_protected_title": "Este enlace público no tiene contraseña",
"problem_share_link_password_incorrect_title": "Contraseña incorrecta",
"problem_share_link_too_many_password_attempts_title": "Demasiadas contraseñas incorrectas",
"problem_share_link_too_many_password_attempts_desc": "Se introdujeron demasiadas contraseñas incorrectas para este enlace público. Inténtalo de nuevo en unos minutos.",
"problem_user_profile_not_found_title": "No se encontró el perfil",
"problem_user_profile_default_public_share_not_found_title": "No se encontró el enlace público predeterminado",
"problem_user_profile_default_public_share_not_found_desc": "Puede que haya caducado o se haya eliminado.",
"problem_user_profile_social_invalid_title": "Red social no válida",
"problem_user_profile_social_invalid_desc": "Los sitios web necesitan una URL completa con https://; las demás redes, solo tu nombre de usuario.",
"problem_shocker_control_no_permission_title": "No tienes permiso para controlar este shocker",
"problem_shocker_control_not_found_title": "No se encontró el shocker",
"problem_shocker_control_paused_title": "El shocker está en pausa",
Expand Down
Loading
Loading