Skip to content

Commit

Permalink
Remove ImportStatementTemplate tests from fragment and operation temp…
Browse files Browse the repository at this point in the history
…late tests
  • Loading branch information
calvincestari committed Mar 10, 2022
1 parent 56581df commit 2fe4b14
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 144 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,78 +84,6 @@ class FragmentTemplateTests: XCTestCase {
expect(actual).to(equalLineByLine(expected, ignoringExtraLines: true))
}

// MARK: - Import Statements

func test__render__givenFileOutput_inSchemaModule_schemaModuleManuallyLinked_generatesImportNotIncludingSchemaModule() throws {
// given
config = .mock(output: .mock(
moduleType: .none,
schemaName: "TestModuleName",
operations: .inSchemaModule
))

let expected =
"""
import ApolloAPI
"""

// when
try buildSubjectAndFragment()

let actual = subject.render()

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

func test__render__givenFileOutput_inSchemaModule_schemaModuleNotManuallyLinked_generatesImportNotIncludingSchemaModule() throws {
// given
config = .mock(output: .mock(
moduleType: .swiftPackageManager,
schemaName: "TestModuleName",
operations: .inSchemaModule
))

let expected =
"""
import ApolloAPI
"""

// when
try buildSubjectAndFragment()

let actual = subject.render()

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

func test__render__givenFileOutput_notInSchemaModule_schemaModuleNotManuallyLinked_generatesImportIncludingSchemaModule() throws {
// given
config = .mock(output: .mock(
moduleType: .swiftPackageManager,
schemaName: "TestModuleName",
operations: .absolute(path: "")
))

let expected =
"""
import ApolloAPI
import TestModuleName
"""

// when
try buildSubjectAndFragment()

let actual = subject.render()

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

// MARK: - Fragment Definition

func test__render__givenFragment_generatesFragmentDeclarationDefinitionAndBoilerplate() throws {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,78 +78,6 @@ class OperationDefinitionTemplateTests: XCTestCase {
expect(actual).to(equalLineByLine(expected, ignoringExtraLines: true))
}

// MARK: - Import Statements

func test__generate__givenFileOutput_inSchemaModule_schemaModuleManuallyLinked_generatesImportNotIncludingSchemaModule() throws {
// given
config = .mock(output: .mock(
moduleType: .none,
schemaName: "TestModuleName",
operations: .inSchemaModule
))

let expected =
"""
import ApolloAPI
"""

// when
try buildSubjectAndOperation()

let actual = subject.render()

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

func test__generate__givenFileOutput_inSchemaModule_schemaModuleNotManuallyLinked_generatesImportNotIncludingSchemaModule() throws {
// given
config = .mock(output: .mock(
moduleType: .swiftPackageManager,
schemaName: "TestModuleName",
operations: .inSchemaModule
))

let expected =
"""
import ApolloAPI
"""

// when
try buildSubjectAndOperation()

let actual = subject.render()

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

func test__generate__givenFileOutput_notInSchemaModule_schemaModuleNotManuallyLinked_generatesImportIncludingSchemaModule() throws {
// given
config = .mock(output: .mock(
moduleType: .swiftPackageManager,
schemaName: "TestModuleName",
operations: .absolute(path: "")
))

let expected =
"""
import ApolloAPI
import TestModuleName
"""

// when
try buildSubjectAndOperation()

let actual = subject.render()

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

// MARK: - Operation Definition

func test__generate__givenQuery_generatesQueryOperation() throws {
Expand Down

0 comments on commit 2fe4b14

Please sign in to comment.