Skip to content

Commit a8b2b18

Browse files
Update dotcom-rendering/src/model/enhanceProductElement.test.ts
Co-authored-by: Jamie B <[email protected]>
1 parent 338cfde commit a8b2b18

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

dotcom-rendering/src/model/enhanceProductElement.test.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,10 @@ describe('enhanceProductBlockElements', () => {
9292

9393
expect(result).toHaveLength(1);
9494

95-
const enhancedElements = (result as ProductBlockElement[])[0];
96-
if (!enhancedElements) throw new Error('enhanced Elements is undefined');
95+
const enhancedElements = result[0];
96+
if (enhancedElements === undefined || enhancedElements._type !== 'model.dotcomrendering.pageElements.ProductBlockElement') {
97+
throw new Error('Expected "enhancedElements" to be a ProductBlockElement');
98+
}
9799

98100
it('enhances the content of a ProductBlockElement', () => {
99101
expect(enhancedElements.content).toEqual(expectedEnhancedContent);

0 commit comments

Comments
 (0)