@@ -47,7 +47,7 @@ class RecordsBuilderTests: XCTestCase {
47
47
DDAssertReflectionEqual ( mutations. adds [ 0 ] . wireframe, next [ 2 ] )
48
48
}
49
49
50
- func testWhenNextWireframesAddsNewRoot_itCreatesFullSnapshotRecord ( ) throws {
50
+ func testWhenNextWireframesAddsNewRoot_itCreatesIncrementalRecord ( ) throws {
51
51
let builder = RecordsBuilder ( telemetry: TelemetryMock ( ) )
52
52
53
53
// Given
@@ -58,8 +58,11 @@ class RecordsBuilderTests: XCTestCase {
58
58
let record = builder. createIncrementalSnapshotRecord ( from: . mockAny( ) , with: next, lastWireframes: previous)
59
59
60
60
// Then
61
- let fullRecord = try XCTUnwrap ( record? . fullSnapshot)
62
- DDAssertReflectionEqual ( fullRecord. data. wireframes, next)
61
+ let incrementalRecord = try XCTUnwrap ( record? . incrementalSnapshot)
62
+ guard case . mutationData = incrementalRecord. data else {
63
+ XCTFail ( " Expected `mutationData` in incremental record, got \( incrementalRecord. data) " )
64
+ return
65
+ }
63
66
}
64
67
65
68
// This case does not need a full snapshot for the player to work, but adding a
@@ -68,15 +71,21 @@ class RecordsBuilderTests: XCTestCase {
68
71
let builder = RecordsBuilder ( telemetry: TelemetryMock ( ) )
69
72
70
73
// Given
71
- let previous : [ SRWireframe ] = [ . mockRandomWith( id: 0 ) , . mockRandomWith( id: 1 ) ]
72
- let next : [ SRWireframe ] = [ . mockRandomWith( id: 1 ) ]
74
+ let previous : [ SRWireframe ] = [
75
+ . shapeWireframe( value: . mockRandomWith( id: 0 ) ) ,
76
+ . shapeWireframe( value: . mockRandomWith( id: 1 ) )
77
+ ]
78
+ let next : [ SRWireframe ] = [ . shapeWireframe( value: . mockRandomWith( id: 1 ) ) ]
73
79
74
80
// When
75
81
let record = builder. createIncrementalSnapshotRecord ( from: . mockAny( ) , with: next, lastWireframes: previous)
76
82
77
83
// Then
78
- let fullRecord = try XCTUnwrap ( record? . fullSnapshot)
79
- DDAssertReflectionEqual ( fullRecord. data. wireframes, next)
84
+ let incrementalRecord = try XCTUnwrap ( record? . incrementalSnapshot)
85
+ guard case . mutationData = incrementalRecord. data else {
86
+ XCTFail ( " Expected `mutationData` in incremental record, got \( incrementalRecord. data) " )
87
+ return
88
+ }
80
89
}
81
90
82
91
func testWhenWireframesAreNotConsistent_itFallbacksToFullSnapshotRecordAndSendsErrorTelemetry( ) throws {
0 commit comments