From 344673078735198c397bb57965eb67ba530b6383 Mon Sep 17 00:00:00 2001 From: Konrad Borowski Date: Fri, 20 Feb 2015 12:15:42 +0100 Subject: [PATCH] Create Flame Orb test Killing Focus Sash Magikarps with one attack is so amazing. --- test/simulator/items/flameorb.js | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 test/simulator/items/flameorb.js diff --git a/test/simulator/items/flameorb.js b/test/simulator/items/flameorb.js new file mode 100644 index 0000000000..99e6c855c6 --- /dev/null +++ b/test/simulator/items/flameorb.js @@ -0,0 +1,31 @@ +var assert = require('assert'); +var battle; + +describe('Flame Orb', function () { + afterEach(function () { + battle.destroy(); + }); + + it('should not trigger when entering battle', function () { + battle = BattleEngine.Battle.construct(); + battle.join('p1', 'Guest 1', 1, [ + {species: 'Magikarp', ability: 'swiftswim', item: 'focussash', moves: ['splash']}, + {species: 'Ursaring', ability: 'guts', item: 'flameorb', moves: ['protect']} + ]); + battle.join('p2', 'Guest 2', 1, [ + {species: 'Breloom', ability: 'technician', moves: ['bulletseed']} + ]); + battle.commitDecisions(); + battle.choose('p1', 'switch 2'); + assert.notStrictEqual(battle.p1.active[0].status, 'brn'); + }); + + it('should trigger after one turn', function () { + battle = BattleEngine.Battle.construct(); + battle.join('p1', 'Guest 1', 1, [{species: 'Ursaring', ability: 'guts', item: 'flameorb', moves: ['protect']}]); + battle.join('p2', 'Guest 2', 1, [{species: 'Magikarp', ability: 'swiftswim', moves: ['splash']}]); + battle.commitDecisions(); + assert.strictEqual(battle.p1.active[0].status, 'brn'); + }); +}); +