mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-26 13:34:36 +00:00
Fix eslint failure (#1921)
## Description: Fix an eslint failure blocking PRs from being merged. ## Please complete the following: - [x] I have added screenshots for all UI updates - [x] I process any text displayed to the user through translateText() and I've added it to the en.json file - [x] I have added relevant tests to the test directory - [x] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced
This commit is contained in:
@@ -67,7 +67,7 @@ export class TerritoryPatternsModal extends LitElement {
|
||||
|
||||
async onUserMe(userMeResponse: UserMeResponse | null) {
|
||||
if (userMeResponse === null) {
|
||||
this.userSettings.setSelectedPatternName(undefined);
|
||||
this.userSettings.setSelectedPattern(undefined);
|
||||
this.selectedPattern = undefined;
|
||||
}
|
||||
this.patterns = await patterns(userMeResponse);
|
||||
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
export class AllianceRequestExecution implements Execution {
|
||||
private req: AllianceRequest | null = null;
|
||||
private active = true;
|
||||
private mg: Game;
|
||||
private mg: Game | undefined;
|
||||
|
||||
constructor(
|
||||
private readonly requestor: Player,
|
||||
@@ -53,6 +53,7 @@ export class AllianceRequestExecution implements Execution {
|
||||
this.active = false;
|
||||
return;
|
||||
}
|
||||
if (this.mg === undefined) throw new Error("Not initialized");
|
||||
if (
|
||||
this.mg.ticks() - (this.req?.createdAt() ?? 0) >
|
||||
this.mg.config().allianceRequestDuration()
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { AllianceRequestExecution } from "../src/core/execution/alliance/AllianceRequestExecution";
|
||||
import { AllianceRequestReplyExecution } from "../src/core/execution/alliance/AllianceRequestReplyExecution";
|
||||
import { Game, Player, PlayerType } from "../src/core/game/Game";
|
||||
import { playerInfo, setup } from "./util/Setup";
|
||||
import { AllianceRequestExecution } from "../src/core/execution/alliance/AllianceRequestExecution";
|
||||
import { AllianceRequestReplyExecution } from "../src/core/execution/alliance/AllianceRequestReplyExecution";
|
||||
|
||||
let game: Game;
|
||||
let player1: Player;
|
||||
@@ -64,13 +64,13 @@ describe("AllianceRequestExecution", () => {
|
||||
game.addExecution(new AllianceRequestExecution(player1, player2.id()));
|
||||
game.executeNextTick();
|
||||
|
||||
expect(player1.outgoingAllianceRequests().length).toBe(1);
|
||||
expect(player1.outgoingAllianceRequests()).toHaveLength(1);
|
||||
|
||||
for (let i = 0; i < 6; i++) {
|
||||
game.executeNextTick();
|
||||
}
|
||||
|
||||
expect(player1.outgoingAllianceRequests().length).toBe(0);
|
||||
expect(player1.outgoingAllianceRequests()).toHaveLength(0);
|
||||
expect(player1.isAlliedWith(player2)).toBeFalsy();
|
||||
expect(player2.isAlliedWith(player1)).toBeFalsy();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user