diff --git a/tests/e2e/api/src/models/settings/setting.ts b/tests/e2e/api/src/models/settings/setting.ts index fe3efd3e411..d557d5c0045 100644 --- a/tests/e2e/api/src/models/settings/setting.ts +++ b/tests/e2e/api/src/models/settings/setting.ts @@ -81,7 +81,7 @@ export class Setting extends Model { * * @type {Object.|null} */ - public readonly options: { [key: string]: string } | null = null; + public readonly options: { [key: string]: string } | undefined; /** * The default value for the setting. diff --git a/tests/e2e/api/src/repositories/rest/products/simple-product.ts b/tests/e2e/api/src/repositories/rest/products/simple-product.ts index 819dccbeab3..7066913b3ed 100644 --- a/tests/e2e/api/src/repositories/rest/products/simple-product.ts +++ b/tests/e2e/api/src/repositories/rest/products/simple-product.ts @@ -13,6 +13,9 @@ function restCreate( httpClient: HTTPClient ): CreateFn< SimpleProductRepository regular_price: properties.regularPrice, }, ); + if ( response.statusCode >= 400 ) { + throw response; + } return Promise.resolve( new SimpleProduct( { id: response.data.id, diff --git a/tests/e2e/api/src/repositories/rest/settings/setting-group.ts b/tests/e2e/api/src/repositories/rest/settings/setting-group.ts index dd6c67697ca..bc71c998fae 100644 --- a/tests/e2e/api/src/repositories/rest/settings/setting-group.ts +++ b/tests/e2e/api/src/repositories/rest/settings/setting-group.ts @@ -6,6 +6,9 @@ import { ListsSettingGroups, SettingGroupRepositoryParams } from '../../../model function restList( httpClient: HTTPClient ): ListFn< SettingGroupRepositoryParams > { return async () => { const response = await httpClient.get( '/wc/v3/settings' ); + if ( response.statusCode >= 400 ) { + throw response; + } const list: SettingGroup[] = []; for ( const raw of response.data ) { diff --git a/tests/e2e/api/src/repositories/rest/settings/setting.ts b/tests/e2e/api/src/repositories/rest/settings/setting.ts index 94b58593d7a..3e26e7d45d8 100644 --- a/tests/e2e/api/src/repositories/rest/settings/setting.ts +++ b/tests/e2e/api/src/repositories/rest/settings/setting.ts @@ -16,6 +16,9 @@ import { function restList( httpClient: HTTPClient ): ListChildFn< SettingRepositoryParams > { return async ( parent ) => { const response = await httpClient.get( '/wc/v3/settings/' + parent.settingGroupID ); + if ( response.statusCode >= 400 ) { + throw response; + } const list: Setting[] = []; for ( const raw of response.data ) { @@ -37,6 +40,9 @@ function restList( httpClient: HTTPClient ): ListChildFn< SettingRepositoryParam function restRead( httpClient: HTTPClient ): ReadChildFn< SettingRepositoryParams > { return async ( parent, id ) => { const response = await httpClient.get( '/wc/v3/settings/' + parent.settingGroupID + '/' + id ); + if ( response.statusCode >= 400 ) { + throw response; + } return Promise.resolve( new Setting( { id: response.data.id, @@ -56,6 +62,9 @@ function restUpdate( httpClient: HTTPClient ): UpdateChildFn< SettingRepositoryP '/wc/v3/settings/' + parent.settingGroupID + '/' + id, params, ); + if ( response.statusCode >= 400 ) { + throw response; + } return Promise.resolve( new Setting( { id: response.data.id,