fix war command differential parity
This commit is contained in:
@@ -183,7 +183,7 @@ describe('war aftermath', () => {
|
||||
defenderNation.rice = 6000;
|
||||
const attackerCity = buildCity(1, 1);
|
||||
const defenderCity = buildCity(2, 2);
|
||||
defenderCity.meta.conflict = JSON.stringify({ 99: 200, 1: 100 });
|
||||
defenderCity.conflict = { 99: 200, 1: 100 };
|
||||
const attacker = buildGeneral(1, 1, 1);
|
||||
attacker.officerLevel = 12;
|
||||
const defender = buildGeneral(2, 2, 2);
|
||||
@@ -236,10 +236,10 @@ describe('war aftermath', () => {
|
||||
expect(attackerNation.rice).toBe(4600);
|
||||
expect(defender.experience).toBe(90);
|
||||
expect(defender.dedication).toBe(50);
|
||||
// Removed nations can remain in old persisted conflict metadata. They
|
||||
// Removed nations can remain in old persisted conflict data. They
|
||||
// must never receive ownership during a later conquest.
|
||||
expect(defenderCity.nationId).toBe(attackerNation.id);
|
||||
expect(defenderCity.meta.conflict).toBe('{}');
|
||||
expect(defenderCity.conflict).toEqual({});
|
||||
expect(outcome.logs.map((log) => log.text)).toEqual(
|
||||
expect.arrayContaining([
|
||||
'<D><b>Nation2</b></>를 정복',
|
||||
|
||||
@@ -300,6 +300,8 @@ describe('war triggers', () => {
|
||||
);
|
||||
cityUnit.setOppose(firstAttacker);
|
||||
expect(cityUnit.addConflict()).toBe(false);
|
||||
expect(city.conflict).toEqual({ 1: 1.05 });
|
||||
expect(city.meta.conflict).toBeUndefined();
|
||||
|
||||
const secondNation = { ...buildNation(), id: 2 };
|
||||
const secondGeneral = { ...buildGeneral(80), id: 2, nationId: 2 };
|
||||
@@ -316,6 +318,7 @@ describe('war triggers', () => {
|
||||
);
|
||||
cityUnit.setOppose(secondAttacker);
|
||||
expect(cityUnit.addConflict()).toBe(true);
|
||||
expect(city.conflict).toEqual({ 1: 1.05, 2: 1 });
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user