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
@ -174,7 +174,7 @@ const ImageUpload: React.FC<ImageUploadProps> = ({
|
||||
<div className={`${buttonContainerClassName} ${unsplashEnabled ? 'relative' : ''}`}>
|
||||
{
|
||||
unsplashEnabled &&
|
||||
<button className={unsplashButtonClassName} type='button' onClick={openUnsplash}>
|
||||
<button className={unsplashButtonClassName} data-testid="toggle-unsplash-button" type='button' onClick={openUnsplash}>
|
||||
{unsplashButtonContent}
|
||||
</button>
|
||||
}
|
||||
|
@ -132,7 +132,7 @@ const BrandSettings: React.FC<{ values: BrandSettingValues, updateSetting: (key:
|
||||
unsplashButtonClassName='!top-1 !right-1 z-50'
|
||||
unsplashEnabled={unsplashEnabled}
|
||||
onDelete={() => updateSetting('cover_image', null)}
|
||||
onUpload={async (file) => {
|
||||
onUpload={async (file: any) => {
|
||||
try {
|
||||
updateSetting('cover_image', getImageUrl(await uploadImage({file})));
|
||||
} 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 modal.getByLabel('Site description').fill('new description');
|
||||
await expect(modal.getByTestId('toggle-unsplash-button')).toBeVisible();
|
||||
// set timeout of 500ms to wait for the debounce
|
||||
await page.waitForTimeout(1000);
|
||||
await modal.getByRole('button', {name: 'Save'}).click();
|
||||
|
Loading…
Reference in New Issue
Block a user