Add test case for stock status parameter.

This commit is contained in:
Jeff Stieler 2021-09-30 08:35:24 -04:00
parent 5d2b908b7d
commit 57e202d313
2 changed files with 10 additions and 1 deletions

View File

@ -875,7 +875,7 @@ const createSampleSimpleProducts = async ( categories, attributes ) => {
grouped_products: [],
menu_order: 0,
related_ids: [ 67, 76, 56, 66 ],
stock_status: 'instock'
stock_status: 'onbackorder'
},
{
name: 'Hoodie with Logo',

View File

@ -418,5 +418,14 @@ const { getRequest } = require( '../../utils/request' );
expect( result.body ).toHaveLength( 1 );
expect( result.body[0].name ).toBe( 'Sunglasses' );
} );
it( 'stock status', async () => {
const result = await productsApi.listAll.products( {
stock_status: 'onbackorder',
} );
expect( result.statusCode ).toEqual( 200 );
expect( result.body ).toHaveLength( 1 );
expect( result.body[0].name ).toBe( 'T-Shirt' );
} );
} );
} );