diff --git a/test/sim/abilities/flowergift.js b/test/sim/abilities/flowergift.js index 62cb54fc04..5c74b5cb0d 100644 --- a/test/sim/abilities/flowergift.js +++ b/test/sim/abilities/flowergift.js @@ -92,5 +92,23 @@ describe('Flower Gift', () => { assert.equal(battle.field.weather, 'raindance'); assert.species(battle.p1.active[0], 'Cherrim'); }); + + it(`transformed Cherrim should transform without Flower Gift`, () => { + battle = common.gen(4).createBattle([[ + { species: 'Ditto', moves: ['transform'] }, + ], [ + { species: 'Cherrim', moves: ['sleeptalk'] }, + { species: 'Torkoal', ability: 'drought', moves: ['sleeptalk'] }, + { species: 'Bulbasaur', ability: 'drizzle', moves: ['sleeptalk'] }, + ]]); + battle.makeChoices(); + battle.makeChoices('move sleeptalk', 'switch 2'); + + assert.equal(battle.field.weather, 'sunnyday'); + assert.species(battle.p1.active[0], 'Cherrim-Sunshine'); + battle.makeChoices('auto', 'switch 3'); + assert.equal(battle.field.weather, 'raindance'); + assert.species(battle.p1.active[0], 'Cherrim'); + }); }); }); diff --git a/test/sim/abilities/forecast.js b/test/sim/abilities/forecast.js new file mode 100644 index 0000000000..579f86c05e --- /dev/null +++ b/test/sim/abilities/forecast.js @@ -0,0 +1,36 @@ +'use strict'; + +const assert = require('./../../assert'); +const common = require('./../../common'); + +let battle; + +describe('Forecast', () => { + afterEach(() => { + battle.destroy(); + }); + + it(`should revert form if it loses its ability`, () => { + battle = common.createBattle([[ + { species: "Castform", ability: 'forecast', moves: ['sleeptalk'] }, + ], [ + { species: "Groudon", ability: 'drought', moves: ['skillswap'] }, + ]]); + assert.species(battle.p1.active[0], 'Castform-Sunny'); + battle.makeChoices(); + assert.species(battle.p1.active[0], 'Castform'); + }); + + describe('[Gen 4]', () => { + it(`should not revert form if it loses its ability`, () => { + battle = common.gen(4).createBattle([[ + { species: "Castform", ability: 'forecast', moves: ['sleeptalk'] }, + ], [ + { species: "Groudon", ability: 'drought', moves: ['skillswap'] }, + ]]); + assert.species(battle.p1.active[0], 'Castform-Sunny'); + battle.makeChoices(); + assert.species(battle.p1.active[0], 'Castform-Sunny'); + }); + }); +});