From 17a15710c0194e8868f2156f3094437396d3c3fd Mon Sep 17 00:00:00 2001 From: Calvin Cestari Date: Thu, 14 Sep 2023 14:26:45 -0700 Subject: [PATCH] Fixed tests --- .../SelectionSetTemplateTests.swift | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/Tests/ApolloCodegenTests/CodeGeneration/Templates/SelectionSet/SelectionSetTemplateTests.swift b/Tests/ApolloCodegenTests/CodeGeneration/Templates/SelectionSet/SelectionSetTemplateTests.swift index 425c1ba61..2ae5e38b5 100644 --- a/Tests/ApolloCodegenTests/CodeGeneration/Templates/SelectionSet/SelectionSetTemplateTests.swift +++ b/Tests/ApolloCodegenTests/CodeGeneration/Templates/SelectionSet/SelectionSetTemplateTests.swift @@ -7439,6 +7439,7 @@ class SelectionSetTemplateTests: XCTestCase { public static var __parentType: ApolloAPI.ParentType { TestSchema.Objects.Dog } public var species: String { __data["species"] } + public var id: String { __data["id"] } } """ @@ -7490,22 +7491,28 @@ class SelectionSetTemplateTests: XCTestCase { } """ - let expectedOne = """ + let expected = """ public struct One: TestSchema.InlineFragment, ApolloAPI.Deferrable { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public typealias RootEntityType = InlineFragment2.Data.AllAnimal + public typealias RootEntityType = TestOperation.Data.AllAnimal public static var __parentType: ApolloAPI.ParentType { TestSchema.Objects.Dog } - """ - let expectedTwo = """ + public var species: String { __data["species"] } + public var id: String? { __data["id"] } + } + public struct Two: TestSchema.InlineFragment, ApolloAPI.Deferrable { public let __data: DataDict public init(_dataDict: DataDict) { __data = _dataDict } - public typealias RootEntityType = InlineFragment2.Data.AllAnimal + public typealias RootEntityType = TestOperation.Data.AllAnimal public static var __parentType: ApolloAPI.ParentType { TestSchema.Objects.Dog } + + public var genus: String { __data["genus"] } + public var id: String? { __data["id"] } + } """ // when @@ -7517,8 +7524,7 @@ class SelectionSetTemplateTests: XCTestCase { let actual = subject.render(inlineFragment: allAnimals_asDog) // then - expect(actual).to(equalLineByLine(expectedOne, atLine: 30, ignoringExtraLines: true)) - expect(actual).to(equalLineByLine(expectedTwo, atLine: 43, ignoringExtraLines: true)) + expect(actual).to(equalLineByLine(expected, atLine: 30, ignoringExtraLines: true)) } // MARK: - InlineFragment RootEntityType Tests