From 689ddd1442f7e83fe51a180a43fe75e383e7fea8 Mon Sep 17 00:00:00 2001 From: James Ward Date: Wed, 19 Aug 2020 15:04:19 -0400 Subject: [PATCH] chore: remove uneccessary cockroachdriver calls in view-entity tests (#6587) this is a backport of changes from the `next` branch --- test/functional/view-entity/mssql/view-entity-mssql.ts | 7 ++----- test/functional/view-entity/mysql/view-entity-mysql.ts | 7 ++----- test/functional/view-entity/oracle/view-entity-oracle.ts | 7 ++----- .../view-entity/postgres/view-entity-postgres.ts | 7 ++----- test/functional/view-entity/sqlite/view-entity-sqlite.ts | 7 ++----- 5 files changed, 10 insertions(+), 25 deletions(-) diff --git a/test/functional/view-entity/mssql/view-entity-mssql.ts b/test/functional/view-entity/mssql/view-entity-mssql.ts index 274f6d34a8e..451d8aeff72 100644 --- a/test/functional/view-entity/mssql/view-entity-mssql.ts +++ b/test/functional/view-entity/mssql/view-entity-mssql.ts @@ -1,6 +1,5 @@ import {expect} from "chai"; import "reflect-metadata"; -import {CockroachDriver} from "../../../../src/driver/cockroachdb/CockroachDriver"; import {Category} from "./entity/Category"; import {Connection} from "../../../../src"; import {closeTestingConnections, createTestingConnections, reloadTestingDatabases} from "../../../utils/test-utils"; @@ -49,13 +48,11 @@ describe("view entity > mssql", () => { const postCategories = await connection.manager.find(PostCategory); postCategories.length.should.be.equal(2); - const postId1 = connection.driver instanceof CockroachDriver ? "1" : 1; - postCategories[0].id.should.be.equal(postId1); + postCategories[0].id.should.be.equal(1); postCategories[0].postName.should.be.equal("About BMW"); postCategories[0].categoryName.should.be.equal("Cars"); - const postId2 = connection.driver instanceof CockroachDriver ? "2" : 2; - postCategories[1].id.should.be.equal(postId2); + postCategories[1].id.should.be.equal(2); postCategories[1].postName.should.be.equal("About Boeing"); postCategories[1].categoryName.should.be.equal("Airplanes"); diff --git a/test/functional/view-entity/mysql/view-entity-mysql.ts b/test/functional/view-entity/mysql/view-entity-mysql.ts index 4ff2e3c84d5..0e8ca35a752 100644 --- a/test/functional/view-entity/mysql/view-entity-mysql.ts +++ b/test/functional/view-entity/mysql/view-entity-mysql.ts @@ -1,6 +1,5 @@ import {expect} from "chai"; import "reflect-metadata"; -import {CockroachDriver} from "../../../../src/driver/cockroachdb/CockroachDriver"; import {Category} from "./entity/Category"; import {Connection} from "../../../../src"; import {closeTestingConnections, createTestingConnections, reloadTestingDatabases} from "../../../utils/test-utils"; @@ -49,13 +48,11 @@ describe("view entity > mysql", () => { const postCategories = await connection.manager.find(PostCategory); postCategories.length.should.be.equal(2); - const postId1 = connection.driver instanceof CockroachDriver ? "1" : 1; - postCategories[0].id.should.be.equal(postId1); + postCategories[0].id.should.be.equal(1); postCategories[0].postName.should.be.equal("About BMW"); postCategories[0].categoryName.should.be.equal("Cars"); - const postId2 = connection.driver instanceof CockroachDriver ? "2" : 2; - postCategories[1].id.should.be.equal(postId2); + postCategories[1].id.should.be.equal(2); postCategories[1].postName.should.be.equal("About Boeing"); postCategories[1].categoryName.should.be.equal("Airplanes"); diff --git a/test/functional/view-entity/oracle/view-entity-oracle.ts b/test/functional/view-entity/oracle/view-entity-oracle.ts index 61cbc0f8173..620cd11e008 100644 --- a/test/functional/view-entity/oracle/view-entity-oracle.ts +++ b/test/functional/view-entity/oracle/view-entity-oracle.ts @@ -1,6 +1,5 @@ import {expect} from "chai"; import "reflect-metadata"; -import {CockroachDriver} from "../../../../src/driver/cockroachdb/CockroachDriver"; import {Category} from "./entity/Category"; import {Connection} from "../../../../src"; import {closeTestingConnections, createTestingConnections, reloadTestingDatabases} from "../../../utils/test-utils"; @@ -49,13 +48,11 @@ describe("view entity > oracle", () => { const postCategories = await connection.manager.find(PostCategory); postCategories.length.should.be.equal(2); - const postId1 = connection.driver instanceof CockroachDriver ? "1" : 1; - postCategories[0].id.should.be.equal(postId1); + postCategories[0].id.should.be.equal(1); postCategories[0].postName.should.be.equal("About BMW"); postCategories[0].categoryName.should.be.equal("Cars"); - const postId2 = connection.driver instanceof CockroachDriver ? "2" : 2; - postCategories[1].id.should.be.equal(postId2); + postCategories[1].id.should.be.equal(2); postCategories[1].postName.should.be.equal("About Boeing"); postCategories[1].categoryName.should.be.equal("Airplanes"); diff --git a/test/functional/view-entity/postgres/view-entity-postgres.ts b/test/functional/view-entity/postgres/view-entity-postgres.ts index c034a4d7465..eb56de2e710 100644 --- a/test/functional/view-entity/postgres/view-entity-postgres.ts +++ b/test/functional/view-entity/postgres/view-entity-postgres.ts @@ -1,6 +1,5 @@ import {expect} from "chai"; import "reflect-metadata"; -import {CockroachDriver} from "../../../../src/driver/cockroachdb/CockroachDriver"; import {Category} from "./entity/Category"; import {Connection} from "../../../../src"; import {closeTestingConnections, createTestingConnections, reloadTestingDatabases} from "../../../utils/test-utils"; @@ -75,13 +74,11 @@ describe("view entity > postgres", () => { const postCategories = await connection.manager.find(PostCategory); postCategories.length.should.be.equal(2); - const postId1 = connection.driver instanceof CockroachDriver ? "1" : 1; - postCategories[0].id.should.be.equal(postId1); + postCategories[0].id.should.be.equal(1); postCategories[0].postName.should.be.equal("About BMW"); postCategories[0].categoryName.should.be.equal("Cars"); - const postId2 = connection.driver instanceof CockroachDriver ? "2" : 2; - postCategories[1].id.should.be.equal(postId2); + postCategories[1].id.should.be.equal(2); postCategories[1].postName.should.be.equal("About Boeing"); postCategories[1].categoryName.should.be.equal("Airplanes"); diff --git a/test/functional/view-entity/sqlite/view-entity-sqlite.ts b/test/functional/view-entity/sqlite/view-entity-sqlite.ts index 108c9bbea1a..3fe63aa72ef 100644 --- a/test/functional/view-entity/sqlite/view-entity-sqlite.ts +++ b/test/functional/view-entity/sqlite/view-entity-sqlite.ts @@ -1,6 +1,5 @@ import {expect} from "chai"; import "reflect-metadata"; -import {CockroachDriver} from "../../../../src/driver/cockroachdb/CockroachDriver"; import {Category} from "./entity/Category"; import {Connection} from "../../../../src"; import {closeTestingConnections, createTestingConnections, reloadTestingDatabases} from "../../../utils/test-utils"; @@ -49,13 +48,11 @@ describe("view entity > sqlite", () => { const postCategories = await connection.manager.find(PostCategory); postCategories.length.should.be.equal(2); - const postId1 = connection.driver instanceof CockroachDriver ? "1" : 1; - postCategories[0].id.should.be.equal(postId1); + postCategories[0].id.should.be.equal(1); postCategories[0].postName.should.be.equal("About BMW"); postCategories[0].categoryName.should.be.equal("Cars"); - const postId2 = connection.driver instanceof CockroachDriver ? "2" : 2; - postCategories[1].id.should.be.equal(postId2); + postCategories[1].id.should.be.equal(2); postCategories[1].postName.should.be.equal("About Boeing"); postCategories[1].categoryName.should.be.equal("Airplanes");