Skip to content

Commit

Permalink
fixup! Deprecate startEngagementWithConfig method
Browse files Browse the repository at this point in the history
This PR deprecates startEngagementWithConfig method and moves it to
deprecated methods file

MOB-2817
  • Loading branch information
rasmustautsglia committed Nov 13, 2023
1 parent 6aa5da3 commit 768c529
Show file tree
Hide file tree
Showing 3 changed files with 3,947 additions and 4 deletions.
8 changes: 4 additions & 4 deletions GliaWidgets/Public/Glia/Glia.Deprecated.swift
Original file line number Diff line number Diff line change
Expand Up @@ -206,10 +206,10 @@ extension Glia {
}
}

/// Deprectated, use ``Glia.startEngagement(engagementKind:in queueIds:features:sceneProvider:)`` instead.
/// Deprecated, use ``Glia.startEngagement(engagementKind:in queueIds:features:sceneProvider:)`` instead.
/// Use ``configure(with configuration:uiConfig:assetsBuilder:completion:)`` to pass in ``RemoteConfiguration``.
@available(*, deprecated, message: """
Deprectated, use ``Glia.startEngagement(engagementKind:in queueIds:features:sceneProvider:)`` instead.
Deprecated, use ``Glia.startEngagement(engagementKind:in queueIds:features:sceneProvider:)`` instead.
Use ``configure(with configuration:uiConfig:assetsBuilder:completion:)`` to pass in ``RemoteConfiguration``.
"""
)
Expand Down Expand Up @@ -242,10 +242,10 @@ extension Glia {
)
}

/// Deprectated, use ``Glia.startEngagement(engagementKind:in queueIds:features:sceneProvider:)`` instead.
/// Deprecated, use ``Glia.startEngagement(engagementKind:in queueIds:features:sceneProvider:)`` instead.
/// Use ``configure(with configuration:uiConfig:theme:assetsBuilder:completion:)`` to pass in ``RemoteConfiguration``.
@available(*, deprecated, message: """
Deprectated, use ``Glia.startEngagement(engagementKind:in queueIds:features:sceneProvider:)`` instead.
Deprecated, use ``Glia.startEngagement(engagementKind:in queueIds:features:sceneProvider:)`` instead.
Use ``configure(with configuration:uiConfig:theme:assetsBuilder:completion:)`` to pass in ``RemoteConfiguration``.
"""
)
Expand Down
48 changes: 48 additions & 0 deletions GliaWidgetsTests/Sources/Glia/GliaTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -401,4 +401,52 @@ final class GliaTests: XCTestCase {
XCTAssertEqual(screenShareHandler.status().value, .stopped)
XCTAssertEqual(calls, [.ended])
}

func test_remoteConfigIsAppliedToThemeUponConfigure() throws {
let themeColor: ThemeColor = .init(
primary: .red,
systemNegative: .red
)

let globalColors: RemoteConfiguration.GlobalColors = .init(
primary: "#00FF00",
secondary: "#00FF00",
baseNormal: "#00FF00",
baseLight: "#00FF00",
baseDark: "#00FF00",
baseShade: "#00FF00",
systemNegative: "#00FF00",
baseNeutral: "#00FF00"
)

let uiConfig: RemoteConfiguration = .init(
globalColors: globalColors,
callScreen: nil,
chatScreen: nil,
surveyScreen: nil,
alert: nil,
bubble: nil,
callVisualizer: nil,
secureConversationsWelcomeScreen: nil,
secureConversationsConfirmationScreen: nil
)

let theme = Theme(colorStyle: .custom(themeColor))
var environment = Glia.Environment.failing
environment.coreSDKConfigurator.configureWithConfiguration = { _, completion in
completion(.success(()))
}
let sdk = Glia(environment: environment)
let configuration = Configuration.mock()
try sdk.configure(
with: configuration,
theme: theme,
uiConfig: uiConfig)
{ _ in }

let primaryColorHex = sdk.theme.color.primary.toRGBAHex(alpha: false)
let systemNegativeHex = sdk.theme.color.systemNegative.toRGBAHex(alpha: false)
XCTAssertEqual(primaryColorHex, "#00FF00")
XCTAssertEqual(systemNegativeHex, "#00FF00")
}
}
Loading

0 comments on commit 768c529

Please sign in to comment.