Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: auto margin in flexbox #667

Merged
merged 4 commits into from Sep 13, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
124 changes: 124 additions & 0 deletions integration_tests/specs/css/css-flexbox/auto-margins.ts
Expand Up @@ -72,4 +72,128 @@ describe('auto-margins', () => {
};
await snapshot();
});

it('align-items should not work when auto margin exists in flex column direction', async () => {
let div;
div = createElement(
'div',
{
style: {
display: 'flex',
flexDirection: 'column',
alignItems: 'flex-end',
width: '300px',
height: '300px',
backgroundColor: 'green'
},
},
[
createElement('div', {
style: {
width: '100px',
height: '100px',
margin: '0 auto',
backgroundColor: 'yellow',
}
}),
]
);

BODY.appendChild(div);

await snapshot();
});

it('align-items should not work when auto margin exists in flex row direction', async () => {
let div;
div = createElement(
'div',
{
style: {
display: 'flex',
flexDirection: 'row',
alignItems: 'flex-end',
width: '300px',
height: '300px',
backgroundColor: 'green'
},
},
[
createElement('div', {
style: {
width: '100px',
height: '100px',
margin: 'auto 0',
backgroundColor: 'yellow',
}
}),
]
);

BODY.appendChild(div);

await snapshot();
});

it('justify-content should not work when auto margin exists in flex column direction', async () => {
let div;
div = createElement(
'div',
{
style: {
display: 'flex',
flexDirection: 'column',
justifyContent: 'flex-end',
width: '300px',
height: '300px',
backgroundColor: 'green'
},
},
[
createElement('div', {
style: {
width: '100px',
height: '100px',
margin: 'auto 0',
backgroundColor: 'yellow',
}
}),
]
);

BODY.appendChild(div);

await snapshot();
});

it('justify-content should not work when auto margin exists in flex row direction', async () => {
let div;
div = createElement(
'div',
{
style: {
display: 'flex',
flexDirection: 'row',
justifyContent: 'flex-end',
width: '300px',
height: '300px',
backgroundColor: 'green'
},
},
[
createElement('div', {
style: {
width: '100px',
height: '100px',
margin: '0 auto',
backgroundColor: 'yellow',
}
}),
]
);

BODY.appendChild(div);

await snapshot();
});
});