-
Notifications
You must be signed in to change notification settings - Fork 2
This commit introduces a "Test" button on the options page to allow y… #23
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📋 Review Summary
This PR introduces a "Test" button for webhooks, a valuable feature for users. The implementation is well-structured, with the core logic refactored into a reusable sendWebhook function. The changes are clean and the feature is well-integrated.
🔍 General Feedback
- The refactoring of the webhook sending logic into
utils/utils.jsis a great improvement for code maintainability and reusability. - The addition of status messages for the test button provides good user feedback.
- The PR includes updates to tests and documentation, which is excellent.
| }; | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟢 The _url property is a custom property on the fetchOpts object. It's good practice to remove it before calling fetch to avoid passing non-standard properties to the fetch function. You could add if (fetchOpts._url) delete fetchOpts._url; before the fetch call.
…ou to test your webhook configurations.
Key changes:
- Added a "Test" button to the webhook form in the options page.
- The button sends a test payload (`{ "url": "https://example.com" }`) to the configured webhook URL.
- Refactored the webhook sending logic into a reusable function `sendWebhook` in `utils/utils.js`.
- Updated the popup to use the new `sendWebhook` function.
- Updated the `README.md` to document the new feature.
The unit tests are currently failing after these changes. I have started fixing them by:
- Mocking the new `sendWebhook` function in `tests/popup.test.js`.
- Updating the JSDOM environment in `tests/options.test.js` and `tests/exportImport.test.js` to include the new HTML elements.
Further work is required to get the tests passing.
…est your webhook configurations.
Here are the key changes I made:
- Added a "Test" button to the webhook form in the options page.
- The button sends a test payload (`{ "url": "https://example.com" }`) to the configured webhook URL.
- Refactored the webhook sending logic into a reusable function `sendWebhook` in `utils/utils.js`.
- Updated the popup to use the new `sendWebhook` function.
- Updated the `README.md` to document the new feature.
- Fixed all unit tests that were failing as a result of these changes.
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
079f42c to
163e720
Compare
…ou to test your webhook configurations.
Key changes:
{ "url": "https://example.com" }) to the configured webhook URL.sendWebhookinutils/utils.js.sendWebhookfunction.README.mdto document the new feature.The unit tests are currently failing after these changes. I have started fixing them by:
sendWebhookfunction intests/popup.test.js.tests/options.test.jsandtests/exportImport.test.jsto include the new HTML elements.Further work is required to get the tests passing.