-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: add missing "comment" field to QB clone method (#7205)
Closes: #7203 Co-authored-by: Astrit Shehu <a.shehu@linkplus-ks.com>
- Loading branch information
1 parent
f730bb9
commit f019771
Showing
2 changed files
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import {closeTestingConnections, createTestingConnections, reloadTestingDatabases} from "../../utils/test-utils"; | ||
import {Connection} from "../../../src/connection/Connection"; | ||
import {expect} from "chai"; | ||
|
||
describe("github issues > #7203 QueryExpressionMap doesn't clone comment field", () => { | ||
let connections: Connection[]; | ||
before( | ||
async () => | ||
(connections = await createTestingConnections({ | ||
dropSchema: true, | ||
enabledDrivers: ["postgres"], | ||
})) | ||
); | ||
beforeEach(() => reloadTestingDatabases(connections)); | ||
after(() => closeTestingConnections(connections)); | ||
|
||
it("should be able to clone comment field", () => Promise.all(connections.map(async connection => { | ||
const comment = "a comment"; | ||
const queryBuilder = await connection.createQueryBuilder().comment(comment); | ||
const clonedQueryBuilder = queryBuilder.clone(); | ||
expect(clonedQueryBuilder.expressionMap.comment).to.be.eq(comment); | ||
}))); | ||
}); |