mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
fix: second argument to shell.writeShortcutLink is optional (#49503)
fix: second argument to shell.writeShortcutLink is optional Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
This commit is contained in:
@@ -172,6 +172,16 @@ describe('shell module', () => {
|
||||
expect(fs.existsSync(tmpShortcut)).to.be.true();
|
||||
});
|
||||
|
||||
it('writes the shortcut with omitted operation (defaults to create)', () => {
|
||||
expect(shell.writeShortcutLink(tmpShortcut, shortcutOptions)).to.be.true();
|
||||
expect(fs.existsSync(tmpShortcut)).to.be.true();
|
||||
expect(shell.readShortcutLink(tmpShortcut)).to.deep.equal(shortcutOptions);
|
||||
|
||||
const newOptions = { ...shortcutOptions, description: 'new description' };
|
||||
expect(shell.writeShortcutLink(tmpShortcut, newOptions)).to.be.true();
|
||||
expect(shell.readShortcutLink(tmpShortcut)).to.deep.equal(newOptions);
|
||||
});
|
||||
|
||||
it('correctly sets the fields', () => {
|
||||
expect(shell.writeShortcutLink(tmpShortcut, shortcutOptions)).to.be.true();
|
||||
expect(shell.readShortcutLink(tmpShortcut)).to.deep.equal(shortcutOptions);
|
||||
|
||||
Reference in New Issue
Block a user