Skip to content

Commit

Permalink
👌 Map context value in FailedExperience
Browse files Browse the repository at this point in the history
  • Loading branch information
mmaatttt committed Sep 20, 2023
1 parent 6b76c38 commit bc7e36b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Sources/AppcuesKit/Data/Models/Experience.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ internal struct FailedExperience: Decodable {
let name: String?
let type: String?
let publishedAt: Int?
let context: Experience.Context?
var error: String?

// This is a synthetically generated Experience from the known values of the FailedExperience that
Expand All @@ -45,7 +46,7 @@ internal struct FailedExperience: Decodable {
name: name ?? "",
type: type ?? "",
publishedAt: publishedAt,
context: nil,
context: context,
traits: [],
steps: [],
redirectURL: nil,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ class ExperienceStateMachineTests: XCTestCase {

func test_stateIsIdling_whenStartFailedExperience_noTransition() throws {
// Arrange
let failedExperience = FailedExperience(id: UUID(), name: "Invalid experience", type: "mobile", publishedAt: 1632142800000, error: "could not decode")
let failedExperience = FailedExperience(id: UUID(), name: "Invalid experience", type: "mobile", publishedAt: 1632142800000, context: nil, error: "could not decode")
let initialState: State = .idling
let experienceData = ExperienceData(failedExperience.skeletonExperience, trigger: .showCall, error: failedExperience.error)
let action: Action = .startExperience(experienceData)
Expand Down

0 comments on commit bc7e36b

Please sign in to comment.