Skip to content

Commit

Permalink
refactor: remove dataTestId
Browse files Browse the repository at this point in the history
This commit undos the changes needed to work with the hotfix for data-testid.
  • Loading branch information
luqven committed Jul 8, 2021
1 parent 83536d6 commit fe1264e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/components/simple/simple.vue
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<template>
<div>
<h2>Simple</h2>
<ix-img src="examples/pione.jpg" sizes="20vw" dataTestId="simple-fluid" />
<ix-img src="examples/pione.jpg" sizes="20vw" data-testid="simple-fluid" />
<h2>Fixed</h2>
<ix-img
src="examples/pione.jpg"
width="100"
fixed
dataTestId="simple-fixed-width"
data-testid="simple-fixed-width"
/>
<h2>Picture</h2>
<div data-testid="simple-picture">
Expand Down
20 changes: 10 additions & 10 deletions tests/unit/imgix-component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ describe('imgix component', () => {
props: {
src: 'examples/pione.jpg',
// TODO(luis): remove this when we have a better way of testing
dataTestId: 'img-rendering',
['data-testid']: 'img-rendering',
},
});

Expand All @@ -31,7 +31,7 @@ describe('imgix component', () => {
render(IxImg, {
props: {
src: 'examples/pione.jpg',
dataTestId: 'img-rendering',
['data-testid']: 'img-rendering',
},
});

Expand All @@ -44,7 +44,7 @@ describe('imgix component', () => {
render(IxImg, {
props: {
src: 'examples/pione.jpg',
dataTestId: 'img-rendering',
['data-testid']: 'img-rendering',
},
});

Expand All @@ -66,7 +66,7 @@ describe('imgix component', () => {
it('imgixParams should be set on the rendered src and srcset', () => {
render(IxImg, {
props: {
dataTestId: 'img-rendering',
['data-testid']: 'img-rendering',
src: 'examples/pione.jpg',
imgixParams: { crop: 'faces' },
},
Expand All @@ -86,7 +86,7 @@ describe('imgix component', () => {
it('ix-img should render a fluid image if width is passed as attribute', () => {
render(IxImg, {
props: {
dataTestId: 'img-rendering',
['data-testid']: 'img-rendering',
src: 'examples/pione.jpg',
width: 100,
},
Expand All @@ -101,7 +101,7 @@ describe('imgix component', () => {
it('the src and srcset should be in fixed size mode when a width is passed to imgixParams', () => {
render(IxImg, {
props: {
dataTestId: 'img-rendering',
['data-testid']: 'img-rendering',
src: 'examples/pione.jpg',
imgixParams: {
w: 100,
Expand All @@ -115,7 +115,7 @@ describe('imgix component', () => {
it('the src and srcset should be in fixed size mode when a fixed prop is passed to the element', () => {
render(IxImg, {
props: {
dataTestId: 'img-rendering',
['data-testid']: 'img-rendering',
src: 'examples/pione.jpg',
width: 100,
height: 150,
Expand All @@ -133,7 +133,7 @@ describe('imgix component', () => {
it('a width attribute should be passed through to the underlying component', () => {
render(IxImg, {
props: {
dataTestId: 'img-rendering',
['data-testid']: 'img-rendering',
src: 'examples/pione.jpg',
width: 100,
},
Expand All @@ -147,7 +147,7 @@ describe('imgix component', () => {
it('a height attribute should be passed through to the underlying component', () => {
render(IxImg, {
props: {
dataTestId: 'img-rendering',
['data-testid']: 'img-rendering',
src: 'examples/pione.jpg',
height: 100,
},
Expand All @@ -166,7 +166,7 @@ describe('imgix component', () => {
it(`${attribute} can be configured to use data-${attribute}`, () => {
render(IxImg, {
props: {
dataTestId: 'img-rendering',
['data-testid']: 'img-rendering',
src: 'examples/pione.jpg',
attributeConfig: {
[attribute]: `data-${attribute}`,
Expand Down

0 comments on commit fe1264e

Please sign in to comment.