Unverified Commit 4d5eaf0e authored by Anderson Leite's avatar Anderson Leite Committed by GitHub

Tests: Adds test to data-nimg data attribute based on layout prop. (#28444)

Adds tests to the Image component to verify that the correct data is being exposed.
Based on #27899 and #28312

## Bug

- [ ] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes
parent 57965770
......@@ -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 () => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment