-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(web): download from shared album link (#7227)
* fix(web): download in album shared link * chore: e2e test
- Loading branch information
Showing
4 changed files
with
66 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import { | ||
AlbumResponseDto, | ||
AssetResponseDto, | ||
LoginResponseDto, | ||
SharedLinkResponseDto, | ||
SharedLinkType, | ||
createAlbum, | ||
createSharedLink, | ||
} from '@immich/sdk'; | ||
import { test } from '@playwright/test'; | ||
import { apiUtils, asBearerAuth, dbUtils } from 'src/utils'; | ||
|
||
test.describe('Shared Links', () => { | ||
let admin: LoginResponseDto; | ||
let asset: AssetResponseDto; | ||
let album: AlbumResponseDto; | ||
let sharedLink: SharedLinkResponseDto; | ||
|
||
test.beforeAll(async () => { | ||
apiUtils.setup(); | ||
await dbUtils.reset(); | ||
admin = await apiUtils.adminSetup(); | ||
asset = await apiUtils.createAsset(admin.accessToken); | ||
album = await createAlbum( | ||
{ | ||
createAlbumDto: { | ||
albumName: 'Test Album', | ||
assetIds: [asset.id], | ||
}, | ||
}, | ||
{ headers: asBearerAuth(admin.accessToken) } | ||
// { headers: asBearerAuth(admin.accessToken)}, | ||
); | ||
sharedLink = await createSharedLink( | ||
{ | ||
sharedLinkCreateDto: { | ||
type: SharedLinkType.Album, | ||
albumId: album.id, | ||
}, | ||
}, | ||
{ headers: asBearerAuth(admin.accessToken) } | ||
); | ||
}); | ||
|
||
test.afterAll(async () => { | ||
await dbUtils.teardown(); | ||
}); | ||
|
||
test('download from a shared link', async ({ page }) => { | ||
await page.goto(`/share/${sharedLink.key}`); | ||
await page.getByRole('heading', { name: 'Test Album' }).waitFor(); | ||
await page.locator('.group > div').first().hover(); | ||
await page.waitForSelector('#asset-group-by-date svg'); | ||
await page.getByRole('checkbox').click(); | ||
await page.getByRole('button', { name: 'Download' }).click(); | ||
await page.getByText('DOWNLOADING').waitFor(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters