17 lines
327 B
TypeScript
17 lines
327 B
TypeScript
/**
|
|
* Internal dependencies
|
|
*/
|
|
import { Products } from '../e2e-jest/fixtures/fixture-data';
|
|
|
|
/**
|
|
* Get products data by key from fixtures.
|
|
*/
|
|
export const getFixtureProductsData = ( key = '' ) => {
|
|
if ( ! key ) {
|
|
return Products();
|
|
}
|
|
return Products()
|
|
.map( ( product ) => product[ key ] )
|
|
.filter( Boolean );
|
|
};
|