|
1 | 1 | import "reflect-metadata" |
2 | 2 | import { Category } from "./entity/Category" |
3 | | -import { Foo1Entity } from "./entity/Foo1" |
4 | | -import { Foo2Entity } from "./entity/Foo2" |
5 | | -import { Foo3Entity } from "./entity/Foo3" |
6 | 3 | import { DataSource } from "../../../../src/data-source/DataSource" |
7 | 4 | import { |
8 | 5 | closeTestingConnections, |
9 | 6 | createTestingConnections, |
10 | 7 | reloadTestingDatabases, |
11 | 8 | } from "../../../utils/test-utils" |
12 | | -import { expect } from "chai" |
13 | 9 |
|
14 | 10 | describe("tree tables > closure-table", () => { |
15 | 11 | let connections: DataSource[] |
@@ -733,127 +729,3 @@ describe("tree tables > closure-table", () => { |
733 | 729 | }), |
734 | 730 | )) |
735 | 731 | }) |
736 | | - |
737 | | -describe("mysql > tree tables > closure-table", () => { |
738 | | - let connections: DataSource[] |
739 | | - before( |
740 | | - async () => |
741 | | - (connections = await createTestingConnections({ |
742 | | - entities: [Foo1Entity, Foo2Entity, Foo3Entity], |
743 | | - enabledDrivers: ["mysql"], |
744 | | - })), |
745 | | - ) |
746 | | - beforeEach(() => reloadTestingDatabases(connections)) |
747 | | - after(() => closeTestingConnections(connections)) |
748 | | - |
749 | | - it("foo1 should create closure columns unsigned", () => |
750 | | - Promise.all( |
751 | | - connections.map(async (dataSource) => { |
752 | | - const fooMetadata = dataSource.entityMetadatas.find( |
753 | | - (el) => el.tableName === "foo1", |
754 | | - )! |
755 | | - |
756 | | - expect(fooMetadata).to.exist |
757 | | - |
758 | | - const fooClosureMetadata = dataSource.entityMetadatas.find( |
759 | | - (el) => el.tableName === "foo1_closure", |
760 | | - )! |
761 | | - |
762 | | - expect(fooClosureMetadata).to.exist |
763 | | - |
764 | | - const ancestorCol = fooClosureMetadata.columns.find( |
765 | | - (col) => col.databaseName === "ancestor_id", |
766 | | - )! |
767 | | - |
768 | | - expect(ancestorCol).to.exist |
769 | | - |
770 | | - const descendantCol = fooClosureMetadata.columns.find( |
771 | | - (col) => col.databaseName === "descendant_id", |
772 | | - )! |
773 | | - |
774 | | - expect(descendantCol).to.exist |
775 | | - |
776 | | - expect(ancestorCol.unsigned).to.be.true |
777 | | - expect(descendantCol.unsigned).to.be.true |
778 | | - }), |
779 | | - )) |
780 | | - |
781 | | - it("foo2 should create closure columns with specified zerofill, width, precision and scale", () => |
782 | | - Promise.all( |
783 | | - connections.map(async (dataSource) => { |
784 | | - const fooMetadata = dataSource.entityMetadatas.find( |
785 | | - (el) => el.tableName === "foo2", |
786 | | - )! |
787 | | - |
788 | | - expect(fooMetadata).to.exist |
789 | | - |
790 | | - const fooClosureMetadata = dataSource.entityMetadatas.find( |
791 | | - (el) => el.tableName === "foo2_closure", |
792 | | - )! |
793 | | - |
794 | | - expect(fooClosureMetadata).to.exist |
795 | | - |
796 | | - const ancestorCol = fooClosureMetadata.columns.find( |
797 | | - (col) => col.databaseName === "ancestor_id", |
798 | | - )! |
799 | | - |
800 | | - expect(ancestorCol).to.exist |
801 | | - |
802 | | - const descendantCol = fooClosureMetadata.columns.find( |
803 | | - (col) => col.databaseName === "descendant_id", |
804 | | - )! |
805 | | - |
806 | | - expect(descendantCol).to.exist |
807 | | - |
808 | | - expect(ancestorCol.zerofill).to.be.true |
809 | | - expect(descendantCol.zerofill).to.be.true |
810 | | - |
811 | | - expect(ancestorCol.width).to.be.eq(13) |
812 | | - expect(descendantCol.width).to.be.eq(13) |
813 | | - |
814 | | - expect(ancestorCol.precision).to.be.eq(9) |
815 | | - expect(descendantCol.precision).to.be.eq(9) |
816 | | - |
817 | | - expect(ancestorCol.scale).to.be.eq(3) |
818 | | - expect(descendantCol.scale).to.be.eq(3) |
819 | | - }), |
820 | | - )) |
821 | | - |
822 | | - it("foo3 should create closure columns with specified length, charset and collation", () => |
823 | | - Promise.all( |
824 | | - connections.map(async (dataSource) => { |
825 | | - const fooMetadata = dataSource.entityMetadatas.find( |
826 | | - (el) => el.tableName === "foo3", |
827 | | - )! |
828 | | - |
829 | | - expect(fooMetadata).to.exist |
830 | | - |
831 | | - const fooClosureMetadata = dataSource.entityMetadatas.find( |
832 | | - (el) => el.tableName === "foo3_closure", |
833 | | - )! |
834 | | - |
835 | | - expect(fooClosureMetadata).to.exist |
836 | | - |
837 | | - const ancestorCol = fooClosureMetadata.columns.find( |
838 | | - (col) => col.databaseName === "ancestor_id", |
839 | | - )! |
840 | | - |
841 | | - expect(ancestorCol).to.exist |
842 | | - |
843 | | - const descendantCol = fooClosureMetadata.columns.find( |
844 | | - (col) => col.databaseName === "descendant_id", |
845 | | - )! |
846 | | - |
847 | | - expect(descendantCol).to.exist |
848 | | - |
849 | | - expect(ancestorCol.length).to.be.eq("201") |
850 | | - expect(descendantCol.length).to.be.eq("201") |
851 | | - |
852 | | - expect(ancestorCol.charset).to.be.eq("latin1") |
853 | | - expect(descendantCol.charset).to.be.eq("latin1") |
854 | | - |
855 | | - expect(ancestorCol.collation).to.be.eq("latin1_bin") |
856 | | - expect(descendantCol.collation).to.be.eq("latin1_bin") |
857 | | - }), |
858 | | - )) |
859 | | -}) |
0 commit comments