mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-07-10 21:14:06 -04:00
Add failing test for gui issues 370
Fix rename increment when renamed to itself
This commit is contained in:
parent
8f45045af0
commit
beaef901a7
2 changed files with 16 additions and 2 deletions
test/unit
|
@ -94,3 +94,18 @@ test('renameSprite increments from existing sprite names', t => {
|
|||
t.equal(vm.runtime.targets[0].sprite.name, 'that name2');
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('renameSprite does not increment when renaming to the same name', t => {
|
||||
const vm = new VirtualMachine();
|
||||
vm.emitTargetsUpdate = () => {};
|
||||
vm.runtime.targets = [{
|
||||
id: 'id1',
|
||||
isSprite: () => true,
|
||||
sprite: {
|
||||
name: 'this name'
|
||||
}
|
||||
}];
|
||||
vm.renameSprite('id1', 'this name');
|
||||
t.equal(vm.runtime.targets[0].sprite.name, 'this name');
|
||||
t.end();
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue