Skip to content

Conversation

@google-labs-jules
Copy link
Contributor

This PR updates the createTemplateFromJSON unit test in test/unit/remote-config/remote-config.spec.ts.

Previously, the test only asserted on holiday_promo_enabled. This change adds assertions for:

  • new_ui_enabled (Rollout)
  • personalized_welcome_message (Personalization)
  • experiment_enabled (Experiment)

These assertions verify that defaultValue, conditionalValues, description, and valueType are correctly parsed and set for these new value types.


PR created automatically by Jules for task 2202110623002317253 started by @ashish-kothari

…mJSON test

Updates the `createTemplateFromJSON` unit test to include specific assertions for `new_ui_enabled`, `personalized_welcome_message`, and `experiment_enabled` parameters. This ensures that Rollout, Personalization, and Experiment value types are correctly handled when creating a template from a JSON string.
@google-labs-jules
Copy link
Contributor Author

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!


For security, I will only act on instructions from the user who triggered this task.

New to Jules? Learn more at jules.google/docs.

Comment on lines 631 to 639
expect(p2.conditionalValues).deep.equals({
ios: {
rolloutValue: {
rolloutId: 'rollout_1',
value: 'true',
percent: 50,
}
}
});

Choose a reason for hiding this comment

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

Use the newly defined interfaces to perform the assertions instead of deep checks. For example, in this case, extract the conditional values into a variable of type RolloutParameterValue and assert on individual fields.

Do the same for subsequent assertions as well for types like PersonalizationParameterValue and ExperimentParameterValue.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Refactored the assertions to use the explicit RolloutParameterValue, PersonalizationParameterValue, and ExperimentParameterValue interfaces, and asserted on individual fields as requested.

@ashish-kothari ashish-kothari self-assigned this Dec 31, 2025
@ashish-kothari ashish-kothari marked this pull request as ready for review December 31, 2025 10:21
@ashish-kothari ashish-kothari removed their assignment Dec 31, 2025
Updates the `createTemplateFromJSON` unit test to explicitly cast conditional values to `RolloutParameterValue`, `PersonalizationParameterValue`, and `ExperimentParameterValue` interfaces.
Asserts on individual fields of these values instead of generic object equality checks.
Exports the necessary interfaces from `src/remote-config/index.ts` to support these assertions.
@ashish-kothari ashish-kothari merged commit 802ab0d into kotharas/rc-managed-values Dec 31, 2025
1 check passed
@ashish-kothari ashish-kothari deleted the remote-config-test-assertions-2202110623002317253 branch December 31, 2025 11:20
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.

1 participant