From 7d37fdf4987e8f5731ff1740025d9fd8fee1bc9d Mon Sep 17 00:00:00 2001 From: Anderson Leite Date: Tue, 24 Aug 2021 17:21:24 +0900 Subject: [PATCH] Tests: Adds test to data-nimg data attribute based on layout prop. --- test/integration/image-component/basic/test/index.test.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/integration/image-component/basic/test/index.test.js b/test/integration/image-component/basic/test/index.test.js index b350812b9502880..e7163430c7368ef 100644 --- a/test/integration/image-component/basic/test/index.test.js +++ b/test/integration/image-component/basic/test/index.test.js @@ -308,6 +308,14 @@ describe('Image Component Tests', () => { it('should not create any preload tags higher up the page than CSS preload tags', async () => { expect(await hasImagePreloadBeforeCSSPreload()).toBe(false) }) + it('should add data-nimg data attribute based on layout', async () => { + expect( + await browser.elementById('image-with-sizes').getAttribute('data-nimg') + ).toBe('responsive') + expect( + await browser.elementById('basic-image').getAttribute('data-nimg') + ).toBe('intrinsic') + }) }) describe('Client-side Image Component Tests', () => { beforeAll(async () => {