Skip to content

Commit

Permalink
Mass search+replace
Browse files Browse the repository at this point in the history
  • Loading branch information
araujoarthur0 committed Jan 13, 2024
1 parent 64e9b15 commit 4f4534b
Show file tree
Hide file tree
Showing 17 changed files with 578 additions and 578 deletions.
72 changes: 36 additions & 36 deletions __tests__/__main__/menus.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ describe('menus.js', () =>
{
it('Should have 3 options', () =>
{
expect(getMainMenuTemplate().length).toBe(3);
assert.toBeStrictEqual(getMainMenuTemplate().length, 3);
});

getMainMenuTemplate().forEach((menu) =>
Expand All @@ -91,22 +91,22 @@ describe('menus.js', () =>
];
if ('type' in menu)
{
expect(menu.type).toBe('separator');
assert.toBeStrictEqual(menu.type, 'separator');
}
else
{
for (const t of tests)
{
expect(menu[t.field]).toBeTruthy();
expect(typeof menu[t.field]).toBe(t.type);
assert.toBeStrictEqual(menu[t.field], true);
assert.toBeStrictEqual(typeof menu[t.field], t.type);
}
if ('id' in menu)
{
expect(typeof menu.id).toBe('string');
assert.toBeStrictEqual(typeof menu.id, 'string');
}
if ('accelerator' in menu)
{
expect(typeof menu.accelerator).toBe('string');
assert.toBeStrictEqual(typeof menu.accelerator, 'string');
}
}
});
Expand Down Expand Up @@ -135,7 +135,7 @@ describe('menus.js', () =>
{
it('Should have 3 options', () =>
{
expect(getContextMenuTemplate().length).toBe(3);
assert.toBeStrictEqual(getContextMenuTemplate().length, 3);
});

getContextMenuTemplate().forEach((menu) =>
Expand All @@ -148,8 +148,8 @@ describe('menus.js', () =>
];
for (const t of tests)
{
expect(menu[t.field]).toBeTruthy();
expect(typeof menu[t.field]).toBe(t.type);
assert.toBeStrictEqual(menu[t.field], true);
assert.toBeStrictEqual(typeof menu[t.field], t.type);
}
});

Expand All @@ -161,7 +161,7 @@ describe('menus.js', () =>
webContents: {
send: (key) =>
{
expect(key).toBe('PUNCH_DATE');
assert.toBeStrictEqual(key, 'PUNCH_DATE');
}
}
};
Expand Down Expand Up @@ -193,7 +193,7 @@ describe('menus.js', () =>
{
it('Should have 1 option', () =>
{
expect(getDockMenuTemplate().length).toBe(1);
assert.toBeStrictEqual(getDockMenuTemplate().length, 1);
});

getDockMenuTemplate().forEach((menu) =>
Expand All @@ -206,8 +206,8 @@ describe('menus.js', () =>
];
for (const t of tests)
{
expect(menu[t.field]).toBeTruthy();
expect(typeof menu[t.field]).toBe(t.type);
assert.toBeStrictEqual(menu[t.field], true);
assert.toBeStrictEqual(typeof menu[t.field], t.type);
}
});
});
Expand All @@ -218,7 +218,7 @@ describe('menus.js', () =>
webContents: {
send: (key) =>
{
expect(key).toBe('PUNCH_DATE');
assert.toBeStrictEqual(key, 'PUNCH_DATE');
}
}
};
Expand All @@ -234,7 +234,7 @@ describe('menus.js', () =>
{
it('Should have 2 option', () =>
{
expect(getViewMenuTemplate().length).toBe(2);
assert.toBeStrictEqual(getViewMenuTemplate().length, 2);
});

getViewMenuTemplate().forEach((menu) =>
Expand All @@ -247,8 +247,8 @@ describe('menus.js', () =>
];
for (const t of tests)
{
expect(menu[t.field]).toBeTruthy();
expect(typeof menu[t.field]).toBe(t.type);
assert.toBeStrictEqual(menu[t.field], true);
assert.toBeStrictEqual(typeof menu[t.field], t.type);
}
});
});
Expand Down Expand Up @@ -284,7 +284,7 @@ describe('menus.js', () =>
{
it('Should have 5 option', () =>
{
expect(getHelpMenuTemplate().length).toBe(5);
assert.toBeStrictEqual(getHelpMenuTemplate().length, 5);
});

getHelpMenuTemplate().forEach((menu) =>
Expand All @@ -297,14 +297,14 @@ describe('menus.js', () =>
];
if ('type' in menu)
{
expect(menu.type).toBe('separator');
assert.toBeStrictEqual(menu.type, 'separator');
}
else
{
for (const t of tests)
{
expect(menu[t.field]).toBeTruthy();
expect(typeof menu[t.field]).toBe(t.type);
assert.toBeStrictEqual(menu[t.field], true);
assert.toBeStrictEqual(typeof menu[t.field], t.type);
}
}
});
Expand All @@ -314,7 +314,7 @@ describe('menus.js', () =>
{
mocks.window = jest.spyOn(shell, 'openExternal').mockImplementation((key) =>
{
expect(key).toBe('https://github.com/thamara/time-to-leave');
assert.toBeStrictEqual(key, 'https://github.com/thamara/time-to-leave');
done();
});
getHelpMenuTemplate()[0].click();
Expand All @@ -324,7 +324,7 @@ describe('menus.js', () =>
{
mocks.window = jest.spyOn(updateManager, 'checkForUpdates').mockImplementation((key) =>
{
expect(key).toBe(true);
assert.toBeStrictEqual(key, true);
done();
});
getHelpMenuTemplate()[1].click();
Expand All @@ -334,7 +334,7 @@ describe('menus.js', () =>
{
mocks.window = jest.spyOn(shell, 'openExternal').mockImplementation((key) =>
{
expect(key).toBe('https://github.com/thamara/time-to-leave/issues/new');
assert.toBeStrictEqual(key, 'https://github.com/thamara/time-to-leave/issues/new');
done();
});
getHelpMenuTemplate()[2].click();
Expand Down Expand Up @@ -381,7 +381,7 @@ describe('menus.js', () =>
{
it('Should have 10 options', () =>
{
expect(getEditMenuTemplate().length).toBe(10);
assert.toBeStrictEqual(getEditMenuTemplate().length, 10);
});

getEditMenuTemplate().forEach((menu) =>
Expand All @@ -393,30 +393,30 @@ describe('menus.js', () =>
];
if ('type' in menu)
{
expect(menu.type).toBe('separator');
assert.toBeStrictEqual(menu.type, 'separator');
}
else
{
for (const t of tests)
{
expect(menu[t.field]).toBeTruthy();
expect(typeof menu[t.field]).toBe(t.type);
assert.toBeStrictEqual(menu[t.field], true);
assert.toBeStrictEqual(typeof menu[t.field], t.type);
}
if ('id' in menu)
{
expect(typeof menu.id).toBe('string');
assert.toBeStrictEqual(typeof menu.id, 'string');
}
if ('accelerator' in menu)
{
expect(typeof menu.accelerator).toBe('string');
assert.toBeStrictEqual(typeof menu.accelerator, 'string');
}
if ('selector' in menu)
{
expect(typeof menu.selector).toBe('string');
assert.toBeStrictEqual(typeof menu.selector, 'string');
}
if ('click' in menu)
{
expect(typeof menu.click).toBe('function');
assert.toBeStrictEqual(typeof menu.click, 'function');
}
}
});
Expand Down Expand Up @@ -451,7 +451,7 @@ describe('menus.js', () =>
webContents: {
send: (key) =>
{
expect(key).toBe('RELOAD_CALENDAR');
assert.toBeStrictEqual(key, 'RELOAD_CALENDAR');
}
}
};
Expand All @@ -476,7 +476,7 @@ describe('menus.js', () =>
webContents: {
send: (key) =>
{
expect(key).toBe('RELOAD_CALENDAR');
assert.toBeStrictEqual(key, 'RELOAD_CALENDAR');
}
}
};
Expand All @@ -501,7 +501,7 @@ describe('menus.js', () =>
webContents: {
send: (key) =>
{
expect(key).toBe('RELOAD_CALENDAR');
assert.toBeStrictEqual(key, 'RELOAD_CALENDAR');
}
}
};
Expand Down Expand Up @@ -560,7 +560,7 @@ describe('menus.js', () =>
webContents: {
send: (key) =>
{
expect(key).toBe('RELOAD_CALENDAR');
assert.toBeStrictEqual(key, 'RELOAD_CALENDAR');
}
}
};
Expand Down
Loading

0 comments on commit 4f4534b

Please sign in to comment.