Skip to content

Commit

Permalink
fix(DataStore): watchOS subscription disabled configuration value (#3432
Browse files Browse the repository at this point in the history
)
  • Loading branch information
lawmicha authored Dec 20, 2023
1 parent 92ff97d commit 22a0cf0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ extension DataStoreConfiguration {
/// enabled is only possible during special circumstances such as actively streaming audio.
/// See https://github.com/aws-amplify/amplify-swift/pull/3368 for more details.
public static var subscriptionsDisabled: DataStoreConfiguration {
.custom(disableSubscriptions: { false })
.custom(disableSubscriptions: { true })
}
#else
/// The default configuration.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,13 @@ class AWSDataStorePluginConfigurationTests: XCTestCase {
override func setUp() async throws {
await Amplify.reset()
}


#if os(watchOS)
func testSubscriptionDisabledTrue() throws {
XCTAssertTrue(DataStoreConfiguration.subscriptionsDisabled.disableSubscriptions())
}
#endif

func testDoesNotThrowOnMissingConfig() throws {
#if os(watchOS)
let plugin = AWSDataStorePlugin(modelRegistration: TestModelRegistration(),
Expand All @@ -33,5 +39,5 @@ class AWSDataStorePluginConfigurationTests: XCTestCase {
XCTFail("Should not throw even if not supplied with a plugin-specific config.")
}
}

}

0 comments on commit 22a0cf0

Please sign in to comment.