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

test(notifications): integ test from hosted endpoints #6006

Merged
merged 4 commits into from
Nov 18, 2024

Conversation

tomcat323
Copy link
Contributor

@tomcat323 tomcat323 commented Nov 13, 2024

integ test for notifications pulling from hosted file endpoints

Test covers:

  1. receiving JSON from endpoints
  2. process notifications criterias
  3. trigger onReceive for newly added notifications

Also updated ruleEngine evaluation logic to skip extension id check if in test enviorments. Since we use a fake extension id for testing.

@tomcat323 tomcat323 marked this pull request as ready for review November 13, 2024 21:29
@tomcat323 tomcat323 requested a review from a team as a code owner November 13, 2024 21:29
@hayemaxi
Copy link
Contributor

hayemaxi commented Nov 13, 2024

/runIntegrationTests

Comment on lines +97 to +101
const state = globals.globalState.get<NotificationsState>(controller.storageKey)
if (state) {
state.newlyReceived.push(existingNotificationID)
await globals.globalState.update(controller.storageKey, state)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

This should usually work, since other tests that run before build the state object if it doesnt exist yet.
But in case the test is running standalone, you should have a default state object. Otherwise, this test will fail.

@hayemaxi
Copy link
Contributor

Nice. It would be cool to expand this integ test into different auth states as well. Maybe even try to get to a point where we aren't stubbing the rule engine.

@hayemaxi hayemaxi merged commit 988dea0 into aws:master Nov 18, 2024
29 of 31 checks passed
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