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

Organized notification test cases #14436

Merged
merged 22 commits into from
Mar 18, 2024
Merged

Conversation

marcusmoore
Copy link
Collaborator

@marcusmoore marcusmoore commented Mar 14, 2024

Description

This PR focuses on notification test organization and clean ups.

I took the following files that contained tests for notifications around check ins and checkouts for their respective checkoutable:

  • tests/Feature/Notifications/AccessoryWebhookTest.php
  • tests/Feature/Notifications/AssetWebhookTest.php
  • tests/Feature/Notifications/ComponentWebhookTest.php
  • tests/Feature/Notifications/ConsumableWebhookTest.php
  • tests/Feature/Notifications/LicenseWebhookTest.php

and split their tests across the following files:

  • tests/Feature/Notifications/Email/EmailNotificationsUponCheckinTest.php
  • tests/Feature/Notifications/Webhooks/SlackNotificationsUponCheckinTest.php
  • tests/Feature/Notifications/Webhooks/SlackNotificationsUponCheckoutTest.php

(Note that the "Webhook" has been replaced with "Slack" since that is what is actually being tested)

Along the way I created improved a helper method name (disablesSlackWebhook()), added a helper trait (AssertsAgainstSlackNotifications), and added a group notifications annotation to these test classes.

Type of change

  • Organization

Copy link

This pull request has been linked to Shortcut Story #24901: Organize tests around notifications.

Copy link

what-the-diff bot commented Mar 14, 2024

PR Summary

  • Removal of Webhook Tests
    Several webhook test files were removed including Accessory, Asset, Component, Consumable, and License Webhook Tests. This implies a change in the way the testing of these functionalities is being done or that they are being deprecated.

  • Introduction of Email Notifications Upon Checkin Test
    A new test has been added specifically for testing the email notifications that are sent when an item is checked in. This ensures that the functionality of sending emails after check-ins works as expected.

  • Introduction of Slack Notifications Upon Checkin Test
    A new test file dedicated to testing the Slack notifications after check-in is added. This ensures that Slack notifications are fired accurately when an item gets checked in.

  • Addition of Slack Notifications Upon Checkout Test
    A new test has been added for the Slack notification functionality for checkouts. This test checks whether the Slack notifications are being sent correctly whenever an item gets checked out.

  • Addition of Support for Asserting Against Slack Notifications
    Helper methods have been added for asserting against Slack notifications. These methods will be beneficial to check whether the Slack notifications are being sent as intended during the test executions.

  • Method Renaming in Support Settings
    The disableWebhook() method in the Settings.php file has been renamed to disableSlackWebhook(). This emphasizes that this method is specifically used for disabling Slack webhooks and promotes clarity in the codebase.

@snipe snipe merged commit 09d69b2 into snipe:develop Mar 18, 2024
8 checks passed
@marcusmoore marcusmoore deleted the chore/sc-24901 branch March 18, 2024 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants