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

Tests Apps in both Objective C and Swift #9

Merged
merged 11 commits into from
Aug 25, 2022
Merged

Conversation

PravinPK
Copy link
Contributor

@PravinPK PravinPK commented Aug 20, 2022

Test App Swift

Test App Objective C

@PravinPK PravinPK requested a review from swarna04 August 24, 2022 23:16
Podfile Show resolved Hide resolved
TestAppObjC/ViewController.m Show resolved Hide resolved
TestApp/AppDelegate.swift Outdated Show resolved Hide resolved
TestApp/AppDelegate.swift Show resolved Hide resolved
TestApp/AppDelegate.swift Outdated Show resolved Hide resolved

class AppDelegate: NSObject, UIApplicationDelegate, UNUserNotificationCenterDelegate {

var pushDetails = PushNotificationDetailClass()
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't we use @StateObject to init PushNotificationDetailClass (which is an ObservableObject)

@StateObject var pushDetails = PushNotificationDetailClass()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No StateObject isn't an ideal choice for use for classes that are not SwiftUI.
We get a warning
"Accessing StateObject's object without being installed on a View. This will create a new instance each time."

TestApp/ContentView.swift Outdated Show resolved Hide resolved
}
}

struct CampaignClassicMockAPICard: View {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Im not sure why we need this when we have enabled the app for Push. We already have integration tests that help inspect and test the outgoing requests for the APIs (happy path).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Most of the time for quick API testing we use the app with simulator. These mocks will certainly help on those times

@PravinPK PravinPK merged commit 16a4cb9 into adobe:dev Aug 25, 2022
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.

3 participants