Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/utils/mjml-component-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export function convertPropsToMjmlAttributes<P>(props: {
return mjmlProps;
}

const booleanToString = ["inline", "full-width"];
const booleanToString = ["inline", "full-width", "fluid-on-mobile"];
const numberToPixel = [
"width",
"height",
Expand Down
5 changes: 4 additions & 1 deletion test/mjml-props.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,16 @@ describe("mjml components prop values", () => {
).toBe(`<mj-raw i-am-not-a-prop="random"></mj-raw>`);
});

it("fullWidth and inline props convert to string", () => {
it("fullWidth, inline, and fluidOnMobile props convert to string", () => {
expect(renderToMjml(<mjmlComponents.MjmlSection fullWidth />)).toBe(
`<mj-section full-width="full-width"></mj-section>`
);
expect(renderToMjml(<mjmlComponents.MjmlStyle inline />)).toBe(
`<mj-style inline="inline"></mj-style>`
);
expect(renderToMjml(<mjmlComponents.MjmlImage fluidOnMobile />)).toBe(
`<mj-image fluid-on-mobile="fluid-on-mobile"></mj-image>`
);
});

it("enum prop type accepts all enum values", () => {
Expand Down