Skip to content

Commit

Permalink
shorter names for GH1972 test
Browse files Browse the repository at this point in the history
  • Loading branch information
imnotjames committed Aug 27, 2020
1 parent 16aa88f commit 2b81b81
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { Entity, TableInheritance, PrimaryGeneratedColumn } from "../../../../sr
type: "varchar",
},
})
export abstract class TournamentParticipant {
export abstract class Participant {
@PrimaryGeneratedColumn()
public id: number;
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { ChildEntity, OneToOne, JoinColumn, ManyToMany, JoinTable } from "../../../../src/index";

import { TournamentParticipant } from "./TournamentParticipant";
import { Participant } from "./Participant";
import { User } from "./User";

@ChildEntity()
export class TournamentSquadParticipant extends TournamentParticipant {
export class SquadParticipant extends Participant {
@OneToOne(type => User, {
eager: true,
})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import {ChildEntity, JoinColumn, OneToOne} from "../../../../src/index";
import {TournamentParticipant} from "./TournamentParticipant";
import {Participant} from "./Participant";
import {User} from "./User";

@ChildEntity()
export class TournamentUserParticipant extends TournamentParticipant {
export class UserParticipant extends Participant {
@OneToOne(type => User, {
eager: true,
})
Expand Down
12 changes: 6 additions & 6 deletions test/github-issues/1972/issue-1972.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import {closeTestingConnections, createTestingConnections, reloadTestingDatabase
import {Connection} from "../../../src";
import {assert} from "chai";
import {User} from "./entity/User";
import {TournamentUserParticipant} from "./entity/TournamentUserParticipant";
import {TournamentSquadParticipant} from "./entity/TournamentSquadParticipant";
import {UserParticipant} from "./entity/UserParticipant";
import {SquadParticipant} from "./entity/SquadParticipant";

describe("github issues > #1972 STI problem - empty columns", () => {
let connections: Connection[];
Expand All @@ -24,13 +24,13 @@ describe("github issues > #1972 STI problem - empty columns", () => {
await connection.manager.save(user);

// create user participant
const tournamentUserParticipant = new TournamentUserParticipant({
const tournamentUserParticipant = new UserParticipant({
user,
});
await connection.manager.save(tournamentUserParticipant);

// find user participant in the DB
const result = await connection.manager.findOne(TournamentUserParticipant);
const result = await connection.manager.findOne(UserParticipant);

if (result) {
assert(result.user instanceof User);
Expand All @@ -45,14 +45,14 @@ describe("github issues > #1972 STI problem - empty columns", () => {
await connection.manager.save(user);

// create tournament squad participant
const tournamentSquadParticipant = new TournamentSquadParticipant({
const tournamentSquadParticipant = new SquadParticipant({
users: [ user ],
owner: user,
});
await connection.manager.save(tournamentSquadParticipant);

// find squad participant in the DB
const result = await connection.manager.findOne(TournamentSquadParticipant);
const result = await connection.manager.findOne(SquadParticipant);

if (result) {
assert(result.owner instanceof User);
Expand Down

0 comments on commit 2b81b81

Please sign in to comment.