From 2fe4b140a4379f85541e2b0b8307650191af0760 Mon Sep 17 00:00:00 2001 From: Calvin Cestari Date: Thu, 10 Mar 2022 11:50:30 -0800 Subject: [PATCH] Remove ImportStatementTemplate tests from fragment and operation template tests --- .../Templates/FragmentTemplateTests.swift | 72 ------------------- .../OperationDefinitionTemplateTests.swift | 72 ------------------- 2 files changed, 144 deletions(-) diff --git a/Tests/ApolloCodegenTests/CodeGeneration/Templates/FragmentTemplateTests.swift b/Tests/ApolloCodegenTests/CodeGeneration/Templates/FragmentTemplateTests.swift index 6d4996dfe4..01ef4b448a 100644 --- a/Tests/ApolloCodegenTests/CodeGeneration/Templates/FragmentTemplateTests.swift +++ b/Tests/ApolloCodegenTests/CodeGeneration/Templates/FragmentTemplateTests.swift @@ -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 { diff --git a/Tests/ApolloCodegenTests/CodeGeneration/Templates/OperationDefinitionTemplateTests.swift b/Tests/ApolloCodegenTests/CodeGeneration/Templates/OperationDefinitionTemplateTests.swift index ca5651da5c..25fb2a2ec8 100644 --- a/Tests/ApolloCodegenTests/CodeGeneration/Templates/OperationDefinitionTemplateTests.swift +++ b/Tests/ApolloCodegenTests/CodeGeneration/Templates/OperationDefinitionTemplateTests.swift @@ -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 {