mirror of
https://github.com/immich-app/immich.git
synced 2025-02-04 01:09:14 -05:00
* feat: toggle password visibility on shared albums * feat: toggle password visibility on shared albums * use password-field component * remove div wrapping PasswordField --------- Co-authored-by: Ian <ian@zetabyte.dev>
This commit is contained in:
parent
ca75bba3b0
commit
a39fbcb8ac
2 changed files with 36 additions and 3 deletions
|
@ -6,7 +6,7 @@ import {
|
||||||
SharedLinkType,
|
SharedLinkType,
|
||||||
createAlbum,
|
createAlbum,
|
||||||
} from '@immich/sdk';
|
} from '@immich/sdk';
|
||||||
import { test } from '@playwright/test';
|
import { expect, test } from '@playwright/test';
|
||||||
import { asBearerAuth, utils } from 'src/utils';
|
import { asBearerAuth, utils } from 'src/utils';
|
||||||
|
|
||||||
test.describe('Shared Links', () => {
|
test.describe('Shared Links', () => {
|
||||||
|
@ -65,6 +65,38 @@ test.describe('Shared Links', () => {
|
||||||
await page.getByRole('heading', { name: 'Test Album' }).waitFor();
|
await page.getByRole('heading', { name: 'Test Album' }).waitFor();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('show-password button visible', async ({ page }) => {
|
||||||
|
await page.goto(`/share/${sharedLinkPassword.key}`);
|
||||||
|
await page.getByPlaceholder('Password').fill('test-password');
|
||||||
|
await page.getByRole('button', { name: 'Show password' }).waitFor();
|
||||||
|
});
|
||||||
|
|
||||||
|
test('view password for shared link', async ({ page }) => {
|
||||||
|
await page.goto(`/share/${sharedLinkPassword.key}`);
|
||||||
|
const input = page.getByPlaceholder('Password');
|
||||||
|
await input.fill('test-password');
|
||||||
|
await page.getByRole('button', { name: 'Show password' }).click();
|
||||||
|
// await page.getByText('test-password', { exact: true }).waitFor();
|
||||||
|
await expect(input).toHaveAttribute('type', 'text');
|
||||||
|
});
|
||||||
|
|
||||||
|
test('hide-password button visible', async ({ page }) => {
|
||||||
|
await page.goto(`/share/${sharedLinkPassword.key}`);
|
||||||
|
const input = page.getByPlaceholder('Password');
|
||||||
|
await input.fill('test-password');
|
||||||
|
await page.getByRole('button', { name: 'Show password' }).click();
|
||||||
|
await page.getByRole('button', { name: 'Hide password' }).waitFor();
|
||||||
|
});
|
||||||
|
|
||||||
|
test('hide password for shared link', async ({ page }) => {
|
||||||
|
await page.goto(`/share/${sharedLinkPassword.key}`);
|
||||||
|
const input = page.getByPlaceholder('Password');
|
||||||
|
await input.fill('test-password');
|
||||||
|
await page.getByRole('button', { name: 'Show password' }).click();
|
||||||
|
await page.getByRole('button', { name: 'Hide password' }).click();
|
||||||
|
await expect(input).toHaveAttribute('type', 'password');
|
||||||
|
});
|
||||||
|
|
||||||
test('show error for invalid shared link', async ({ page }) => {
|
test('show error for invalid shared link', async ({ page }) => {
|
||||||
await page.goto('/share/invalid');
|
await page.goto('/share/invalid');
|
||||||
await page.getByRole('heading', { name: 'Invalid share key' }).waitFor();
|
await page.getByRole('heading', { name: 'Invalid share key' }).waitFor();
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
import ControlAppBar from '$lib/components/shared-components/control-app-bar.svelte';
|
import ControlAppBar from '$lib/components/shared-components/control-app-bar.svelte';
|
||||||
import ImmichLogoSmallLink from '$lib/components/shared-components/immich-logo-small-link.svelte';
|
import ImmichLogoSmallLink from '$lib/components/shared-components/immich-logo-small-link.svelte';
|
||||||
import ThemeButton from '$lib/components/shared-components/theme-button.svelte';
|
import ThemeButton from '$lib/components/shared-components/theme-button.svelte';
|
||||||
|
import PasswordField from '$lib/components/shared-components/password-field.svelte';
|
||||||
import { user } from '$lib/stores/user.store';
|
import { user } from '$lib/stores/user.store';
|
||||||
import { handleError } from '$lib/utils/handle-error';
|
import { handleError } from '$lib/utils/handle-error';
|
||||||
import { getMySharedLink, SharedLinkType } from '@immich/sdk';
|
import { getMySharedLink, SharedLinkType } from '@immich/sdk';
|
||||||
|
@ -80,8 +81,8 @@
|
||||||
{$t('sharing_enter_password')}
|
{$t('sharing_enter_password')}
|
||||||
</div>
|
</div>
|
||||||
<div class="mt-4">
|
<div class="mt-4">
|
||||||
<form novalidate autocomplete="off" {onsubmit}>
|
<form class="flex gap-x-2" novalidate {onsubmit}>
|
||||||
<input type="password" class="immich-form-input mr-2" placeholder={$t('password')} bind:value={password} />
|
<PasswordField autocomplete="off" bind:password placeholder="Password" />
|
||||||
<Button type="submit">{$t('submit')}</Button>
|
<Button type="submit">{$t('submit')}</Button>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Add table
Reference in a new issue