mirror of
https://github.com/streetwriters/notesnook.git
synced 2026-09-01 19:49:54 +02:00
web: replace date-time in test snapshot with xxx
This commit is contained in:
committed by
Abdullah Atta
parent
1521a7d120
commit
bbb43bc8b4
@@ -234,18 +234,17 @@ export class NoteContextMenuModel extends BaseProperties {
|
||||
await this.open();
|
||||
await this.menu.clickOnItem("export");
|
||||
|
||||
// we need to override date time so
|
||||
// date created & date edited remain fixed.
|
||||
await this.noteLocator.evaluate(() => {
|
||||
// eslint-disable-next-line no-extend-native
|
||||
Date.prototype.toLocaleString = () => "xxx";
|
||||
});
|
||||
|
||||
return await downloadAndReadFile(
|
||||
const content = await downloadAndReadFile(
|
||||
this.noteLocator.page(),
|
||||
this.menu.getItem(format),
|
||||
"utf-8"
|
||||
);
|
||||
if (format === "html") {
|
||||
return content
|
||||
.replace(/(name="created-on" content=")(.+?)"/, '$1xxx"')
|
||||
.replace(/(name="last-edited-on" content=")(.+?)"/, '$1xxx"');
|
||||
}
|
||||
return content;
|
||||
}
|
||||
|
||||
async addToNotebook(notebook: Notebook) {
|
||||
|
||||
Reference in New Issue
Block a user