Skip to content

Commit

Permalink
Extend timeouts in useCKEditorCloud tests to make them less flaky
Browse files Browse the repository at this point in the history
  • Loading branch information
Mati365 committed Oct 3, 2024
1 parent f7838de commit 83d74e2
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions tests/useCKEditorCloud.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import type { CKEditorCloudConfig } from '@ckeditor/ckeditor5-integrations-commo

import useCKEditorCloud from '../src/useCKEditorCloud.js';

describe( 'useCKEditorCloud', () => {
describe( 'useCKEditorCloud', { timeout: 8000 }, () => {
beforeEach( removeAllCkCdnResources );

it( 'should load CKEditor bundle from CDN', async () => {
Expand All @@ -36,7 +36,7 @@ describe( 'useCKEditorCloud', () => {
await vi.waitFor( () => {
expect( data.value?.CKEditor ).toBeDefined();
expect( data.value?.CKEditorPremiumFeatures ).toBeDefined();
} );
}, { timeout: 4000 } );
} );

it( 'should load additional resources from CDN after updating config ref', async () => {
Expand All @@ -51,7 +51,7 @@ describe( 'useCKEditorCloud', () => {
await vi.waitFor( () => {
expect( data.value?.CKEditor ).toBeDefined();
expect( data.value?.CKEditorPremiumFeatures ).toBeDefined();
} );
}, { timeout: 4000 } );
} );

describe( 'typings', () => {
Expand All @@ -60,9 +60,10 @@ describe( 'useCKEditorCloud', () => {
version: '43.0.0',
premium: true
} );

await vi.waitFor( () => {
expect( data.value?.CKEditor ).toBeDefined();
} );
}, { timeout: 4000 } );

if ( data.value ) {
expectTypeOf( data.value?.CKEditorPremiumFeatures ).not.toBeNullable();
Expand All @@ -76,7 +77,7 @@ describe( 'useCKEditorCloud', () => {

await vi.waitFor( () => {
expect( data.value?.CKEditor ).toBeDefined();
} );
}, { timeout: 4000 } );

if ( data.value ) {
expectTypeOf( data.value.CKEditorPremiumFeatures ).toBeNullable();
Expand All @@ -91,7 +92,7 @@ describe( 'useCKEditorCloud', () => {

await vi.waitFor( () => {
expect( data.value?.CKEditor ).toBeDefined();
} );
}, { timeout: 4000 } );

if ( data.value ) {
expectTypeOf( data.value.CKEditorPremiumFeatures ).toBeNullable();
Expand All @@ -108,7 +109,7 @@ describe( 'useCKEditorCloud', () => {

await vi.waitFor( () => {
expect( data.value?.CKEditor ).toBeDefined();
} );
}, { timeout: 4000 } );

if ( data.value ) {
expectTypeOf( data.value.CKBox ).not.toBeNullable();
Expand All @@ -122,7 +123,7 @@ describe( 'useCKEditorCloud', () => {

await vi.waitFor( () => {
expect( data.value?.CKEditor ).toBeDefined();
} );
}, { timeout: 4000 } );

if ( data.value ) {
expectTypeOf( data.value.CKBox ).toBeNullable();
Expand Down

0 comments on commit 83d74e2

Please sign in to comment.