Skip to content

Commit

Permalink
Another test
Browse files Browse the repository at this point in the history
  • Loading branch information
calvincestari committed Sep 12, 2023
1 parent 30a7510 commit d702f02
Showing 1 changed file with 42 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,48 @@ class OperationDefinitionTemplateTests: XCTestCase {
expect(actual).to(equalLineByLine(expected, atLine: 9, ignoringExtraLines: true))
}

func test__generate__givenQueryWithNamedFragment_withDeferredTypeCase_generatesDeferredPropertyTrue() throws {
// given
schemaSDL = """
type Query {
allAnimals: [Animal!]
}
interface Animal {
species: String!
}
type Dog implements Animal {
species: String!
}
"""

document = """
query TestOperation {
allAnimals {
... DogFragment
}
}
fragment DogFragment on Animal {
... on Dog @defer(label: "root") {
species
}
}
"""

let expected = """
public static let hasDeferredFragments: Bool = true
"""

// when
try buildSubjectAndOperation()
let actual = renderSubject()

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

// MARK: - Selection Set Declaration

func test__generate__givenOperationSelectionSet_rendersDeclaration() throws {
Expand Down

0 comments on commit d702f02

Please sign in to comment.