mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-06 22:40:14 -05:00
Updated test to check for Unsplash button in Admin (#19814)
ref DES-167 https://linear.app/tryghost/issue/DES-167/🐛-unsplash-in-admin-x-not-styled-correctly
This commit is contained in:
parent
ae5df293c3
commit
8a67901355
3 changed files with 3 additions and 2 deletions
|
@ -174,7 +174,7 @@ const ImageUpload: React.FC<ImageUploadProps> = ({
|
||||||
<div className={`${buttonContainerClassName} ${unsplashEnabled ? 'relative' : ''}`}>
|
<div className={`${buttonContainerClassName} ${unsplashEnabled ? 'relative' : ''}`}>
|
||||||
{
|
{
|
||||||
unsplashEnabled &&
|
unsplashEnabled &&
|
||||||
<button className={unsplashButtonClassName} type='button' onClick={openUnsplash}>
|
<button className={unsplashButtonClassName} data-testid="toggle-unsplash-button" type='button' onClick={openUnsplash}>
|
||||||
{unsplashButtonContent}
|
{unsplashButtonContent}
|
||||||
</button>
|
</button>
|
||||||
}
|
}
|
||||||
|
|
|
@ -132,7 +132,7 @@ const BrandSettings: React.FC<{ values: BrandSettingValues, updateSetting: (key:
|
||||||
unsplashButtonClassName='!top-1 !right-1 z-50'
|
unsplashButtonClassName='!top-1 !right-1 z-50'
|
||||||
unsplashEnabled={unsplashEnabled}
|
unsplashEnabled={unsplashEnabled}
|
||||||
onDelete={() => updateSetting('cover_image', null)}
|
onDelete={() => updateSetting('cover_image', null)}
|
||||||
onUpload={async (file) => {
|
onUpload={async (file: any) => {
|
||||||
try {
|
try {
|
||||||
updateSetting('cover_image', getImageUrl(await uploadImage({file})));
|
updateSetting('cover_image', getImageUrl(await uploadImage({file})));
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|
|
@ -129,6 +129,7 @@ test.describe('Design settings', async () => {
|
||||||
await expect(modal.frameLocator('[data-testid="theme-preview"] iframe[data-visible=true]').getByText('homepage preview')).toHaveCount(1);
|
await expect(modal.frameLocator('[data-testid="theme-preview"] iframe[data-visible=true]').getByText('homepage preview')).toHaveCount(1);
|
||||||
|
|
||||||
await modal.getByLabel('Site description').fill('new description');
|
await modal.getByLabel('Site description').fill('new description');
|
||||||
|
await expect(modal.getByTestId('toggle-unsplash-button')).toBeVisible();
|
||||||
// set timeout of 500ms to wait for the debounce
|
// set timeout of 500ms to wait for the debounce
|
||||||
await page.waitForTimeout(1000);
|
await page.waitForTimeout(1000);
|
||||||
await modal.getByRole('button', {name: 'Save'}).click();
|
await modal.getByRole('button', {name: 'Save'}).click();
|
||||||
|
|
Loading…
Reference in a new issue