Skip to content

issue-5063 changes #5083

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

Open
wants to merge 2 commits into
base: unstable
Choose a base branch
from

Conversation

yeshwanth235
Copy link

Summary

Changed Alert Component to KModel

image

References

#5063

Reviewer guidance

Export data from setting->account
click Export data button

@MisRob MisRob self-requested a review June 3, 2025 03:16
@MisRob MisRob self-assigned this Jun 3, 2025
Copy link
Member

@MisRob MisRob left a comment

Choose a reason for hiding this comment

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

Hi @yeshwanth235, nice work here, and all works as expected. Leaving few comments for code.


<KModal
v-if="showExportDataNotice"
:appendToOverlay="true"
Copy link
Member

Choose a reason for hiding this comment

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

Is this needed? Were there any issues with stacking when it weren't present?

:submitText="$tr('exportDataBtn')"
@submit="showExportDataNotice = false"
:title="$tr('exportStartedHeader')">
<template> {{ $tr('exportAccountDataModalMessage') }} </template>
Copy link
Member

Choose a reason for hiding this comment

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

I think that wrapping text in <template> shouldn't be needed

@@ -204,6 +208,9 @@
channelLink(id) {
return window.Urls.channel(id);
},
closeExportDataNotice() {
Copy link
Member

Choose a reason for hiding this comment

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

This method is not used from anywhere. Can be removed.

exportData.mockImplementation(() => Promise.resolve());
await wrapper.find('[data-test="export-link"]').trigger('click');
await wrapper.find('.actions .button').trigger('click');
expect(wrapper.vm.showExportDataNotice).toBe(false);
Copy link
Member

Choose a reason for hiding this comment

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

Testing whether a modal is displayed via checking on showExportDataNotice value would be a fragile approach. Imagine a situation when we'd re-implement or removed internal data such as showExportDataNotice. Then this test could pass even if the form weren't visible, or fail if it was. For that reason, it's a good practice to write test as close as possible to actual user experience. Here, we'd want to do something similar to this test - check for KModal presence and make sure that the right modal is displayed via checking its text. Before we merge, let's resolve this.

I realize this is a pattern that is present in other tests around this dialog. If you'd like to fix them too, that'd be welcome, but it's not required as it was pre-existing.

Copy link
Author

@yeshwanth235 yeshwanth235 Jun 4, 2025

Choose a reason for hiding this comment

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

Sure, will update

Copy link
Member

Choose a reason for hiding this comment

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

Thanks @yeshwanth235, just mention me in the PR if you had any questions or as soon as all feedback is resolved.

Copy link
Member

Choose a reason for hiding this comment

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

Thanks for following the guidance and updating these!

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