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

Some fixes for view duration and added tests #347

Merged
merged 10 commits into from
Oct 31, 2024
Merged

Conversation

ijunaid
Copy link
Contributor

@ijunaid ijunaid commented Oct 14, 2024

No description provided.

wait(for: [pauseViewExpectation, resumeViewExpectation], timeout: 10)
}

func testViewTrackingWithBackgroundAndForegroundNotifications() throws {
Copy link
Member

Choose a reason for hiding this comment

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

addition of test comments would be great

Copy link
Member

@arifBurakDemiray arifBurakDemiray left a comment

Choose a reason for hiding this comment

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

This is a nice addition of test suite.
It might be extended by scenarios
For example what happens after consent removal etc.

}

wait(for: [expectation], timeout: 5.0) // Wait for the expectation to be fulfilled
checkRecordedEventsForView(viewName: "View1")
Copy link
Member

Choose a reason for hiding this comment

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

you may also want to validate duration of the views

resumeViewExpectation.fulfill()
}
wait(for: [expectation], timeout: 5.0) // Wait for the expectation to be fulfilled
checkRecordedEventsForView(viewName: "View1", segmentation: ["key": "value"])
Copy link
Member

Choose a reason for hiding this comment

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

for example here. View must have a duration of 4 secondo

NotificationCenter.default.post(name: UIApplication.didBecomeActiveNotification, object: nil)
fgExpectation.fulfill()
wait(for: [expectation], timeout: 5.0) // Wait for the expectation to be fulfilled
checkRecordedEventsForView(withID: viewID)
Copy link
Member

Choose a reason for hiding this comment

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

we want to see specifically also those durations are validated and SDK correctly calculates the duration

Copy link
Member

@AliRKat AliRKat left a comment

Choose a reason for hiding this comment

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

cool work! looks all good to me. just couldn't be sure whether we validate each param under a view request or not but I don't think there's anything wrong with the current way

@turtledreams turtledreams merged commit 9f9fb38 into staging Oct 31, 2024
16 checks passed
@turtledreams turtledreams deleted the view-fixes-&-tests branch October 31, 2024 09:55
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.

4 participants