mirror of
https://github.com/smogon/pokemon-showdown.git
synced 2026-05-23 08:16:16 -05:00
- This cuts down tons of code that define player names, avatars, and deal with Team Preview.
61 lines
2.6 KiB
JavaScript
61 lines
2.6 KiB
JavaScript
'use strict';
|
|
|
|
const assert = require('./../../assert');
|
|
const common = require('./../../common');
|
|
|
|
let battle;
|
|
|
|
describe('Knock Off', function () {
|
|
afterEach(function () {
|
|
battle.destroy();
|
|
});
|
|
|
|
it('should remove most items', function () {
|
|
battle = common.createBattle();
|
|
battle.join('p1', 'Guest 1', 1, [{species: "Mew", ability: 'synchronize', moves: ['knockoff']}]);
|
|
battle.join('p2', 'Guest 2', 1, [{species: "Blissey", ability: 'naturalcure', item: 'shedshell', moves: ['softboiled']}]);
|
|
battle.commitDecisions();
|
|
assert.strictEqual(battle.p2.active[0].item, '');
|
|
});
|
|
|
|
it('should not remove plates from Arceus', function () {
|
|
battle = common.createBattle();
|
|
battle.join('p1', 'Guest 1', 1, [{species: "Mew", ability: 'synchronize', moves: ['knockoff']}]);
|
|
battle.join('p2', 'Guest 2', 1, [{species: "Arceus", ability: 'download', item: 'flameplate', moves: ['swordsdance']}]);
|
|
battle.commitDecisions();
|
|
assert.strictEqual(battle.p2.active[0].item, 'flameplate');
|
|
});
|
|
|
|
it('should not remove drives from Genesect', function () {
|
|
battle = common.createBattle();
|
|
battle.join('p1', 'Guest 1', 1, [{species: "Mew", ability: 'synchronize', moves: ['knockoff']}]);
|
|
battle.join('p2', 'Guest 2', 1, [{species: "Genesect", ability: 'download', item: 'dousedrive', moves: ['shiftgear']}]);
|
|
battle.commitDecisions();
|
|
assert.strictEqual(battle.p2.active[0].item, 'dousedrive');
|
|
});
|
|
|
|
it('should not remove correctly held mega stones', function () {
|
|
battle = common.createBattle();
|
|
battle.join('p1', 'Guest 1', 1, [{species: "Mew", ability: 'synchronize', moves: ['knockoff']}]);
|
|
battle.join('p2', 'Guest 2', 1, [{species: "Scizor", ability: 'technician', item: 'scizorite', moves: ['swordsdance']}]);
|
|
battle.commitDecisions();
|
|
assert.strictEqual(battle.p2.active[0].item, 'scizorite');
|
|
});
|
|
|
|
it('should remove wrong mega stones', function () {
|
|
battle = common.createBattle();
|
|
battle.join('p1', 'Guest 1', 1, [{species: "Mew", ability: 'synchronize', moves: ['knockoff']}]);
|
|
battle.join('p2', 'Guest 2', 1, [{species: "Scizor", ability: 'technician', item: 'audinite', moves: ['swordsdance']}]);
|
|
battle.commitDecisions();
|
|
assert.strictEqual(battle.p2.active[0].item, '');
|
|
});
|
|
|
|
it('should not remove items if the user faints mid-move', function () {
|
|
battle = common.createBattle();
|
|
battle.join('p1', 'Guest 1', 1, [{species: "Shedinja", ability: 'wonderguard', moves: ['knockoff']}]);
|
|
battle.join('p2', 'Guest 2', 1, [{species: "Ferrothorn", ability: 'ironbarbs', item: 'rockyhelmet', moves: ['curse']}]);
|
|
battle.commitDecisions();
|
|
assert.strictEqual(battle.p2.active[0].item, 'rockyhelmet');
|
|
});
|
|
});
|