Skip to content

Commit

Permalink
Updates tests
Browse files Browse the repository at this point in the history
  • Loading branch information
calvincestari committed Sep 18, 2024
1 parent dfa8a41 commit 9c991b3
Showing 1 changed file with 7 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ class SelectionSetTemplate_LocalCacheMutationTests: XCTestCase {
let actual = subject.test_render(childEntity: allAnimals.computed)

// then
expect(actual).to(equalLineByLine(expected, atLine: 18, ignoringExtraLines: true))
expect(actual).to(equalLineByLine(expected, atLine: 15, ignoringExtraLines: true))
}

// MARK: - Accessor Tests
Expand Down Expand Up @@ -263,7 +263,7 @@ class SelectionSetTemplate_LocalCacheMutationTests: XCTestCase {
expect(actual).to(equalLineByLine(expected, atLine: 12, ignoringExtraLines: true))
}

func test__render_inlineFragmentAccessors__rendersAccessorWithGetterAndSetter() async throws {
func test__render_inlineFragmentAccessors__rendersAccessorWithGetterOnly() async throws {
// given
schemaSDL = """
type Query {
Expand All @@ -290,10 +290,7 @@ class SelectionSetTemplate_LocalCacheMutationTests: XCTestCase {
"""

let expected = """
public var asDog: AsDog? {
get { _asInlineFragment() }
set { if let newData = newValue?.__data._data { __data._data = newData }}
}
public var asDog: AsDog? { _asInlineFragment() }
"""

// when
Expand Down Expand Up @@ -391,7 +388,7 @@ class SelectionSetTemplate_LocalCacheMutationTests: XCTestCase {
let actual = subject.test_render(childEntity: allAnimals.computed)

// then
expect(actual).to(equalLineByLine(expected, atLine: 21, ignoringExtraLines: true))
expect(actual).to(equalLineByLine(expected, atLine: 18, ignoringExtraLines: true))
}

// MARK: - Casing Tests
Expand Down Expand Up @@ -435,7 +432,7 @@ class SelectionSetTemplate_LocalCacheMutationTests: XCTestCase {
public struct AsDog: Myschema.MutableInlineFragment {
"""

expect(actual).to(equalLineByLine(expected, atLine: 18, ignoringExtraLines: true))
expect(actual).to(equalLineByLine(expected, atLine: 15, ignoringExtraLines: true))
}

func test__casingForMutableInlineFragment__givenUppercasedSchemaName_generatesUppercasedNamespace() async throws {
Expand Down Expand Up @@ -477,7 +474,7 @@ class SelectionSetTemplate_LocalCacheMutationTests: XCTestCase {
public struct AsDog: MYSCHEMA.MutableInlineFragment {
"""

expect(actual).to(equalLineByLine(expected, atLine: 18, ignoringExtraLines: true))
expect(actual).to(equalLineByLine(expected, atLine: 15, ignoringExtraLines: true))
}

func test__casingForMutableInlineFragment__givenCapitalizedSchemaName_generatesCapitalizedNamespace() async throws {
Expand Down Expand Up @@ -519,6 +516,6 @@ class SelectionSetTemplate_LocalCacheMutationTests: XCTestCase {
public struct AsDog: MySchema.MutableInlineFragment {
"""

expect(actual).to(equalLineByLine(expected, atLine: 18, ignoringExtraLines: true))
expect(actual).to(equalLineByLine(expected, atLine: 15, ignoringExtraLines: true))
}
}

0 comments on commit 9c991b3

Please sign in to comment.