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 usage of nested objects in environments #2249

Merged
merged 1 commit into from
Jun 9, 2020

Conversation

gschier
Copy link
Contributor

@gschier gschier commented Jun 4, 2020

This PR fixes an issue where object properties within arrays disappear.

image

image

@gschier gschier requested a review from develohpanda June 4, 2020 18:04
@netlify
Copy link

netlify bot commented Jun 4, 2020

Deploy preview for insomnia-storybook ready!

Built with commit 4ca9b98

https://deploy-preview-2249--insomnia-storybook.netlify.app

Copy link
Contributor

@develohpanda develohpanda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, nice catch on the PREFIX vs SEPARATOR

environment: {
foo: 'parent',
ancestor: true,
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if this change is triggered by your IDE and not controlled by ESLint/prettier rules? It shouldn't happen now that there is one source of truth for linting everywhere.

const rendered = await renderUtils.render('Hello {{ users[0].name }}!', {
users: [{ name: 'Niji' }],
});
expect(rendered).toBe('Hello Niji!');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yay tests 🤗

Comment on lines +376 to +379
name: 'Grandparent',
type: models.requestGroup.type,
environment: {
users: [{ name: 'Mike' }, { name: 'Opender' }],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're not that old 😉

@@ -44,7 +44,7 @@ export async function buildRenderContext(
const ordered = orderedJSON.order(
rootEnvironment.data,
rootEnvironment.dataPropertyOrder,
JSON_ORDER_PREFIX,
JSON_ORDER_SEPARATOR,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ooft, nice catch 👍

@gschier gschier changed the title Fix usable of nested objects in environments Fix usage of nested objects in environments Jun 7, 2020
@gschier gschier merged commit 7f4a552 into develop Jun 9, 2020
@gschier gschier deleted the fix/nested-environment-arr branch June 9, 2020 21:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants