Skip to content

Commit e0eb300

Browse files
committed
fixes to failing tests after jgclark ParentsAndChildren refactor
1 parent d52bb96 commit e0eb300

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

helpers/__tests__/NPParagraph.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import moment from 'moment'
33
import { CustomConsole } from '@jest/console' // see note below
44
import * as p from '../NPParagraph'
55
import { clo, logDebug, logInfo } from '../dev'
6-
// import { paragraphMatches, getParagraphParentsOnly, getChildParas, getIndentedNonTaskLinesUnderPara, removeParentsWhoAreChildren } from '../NPParagraph'
6+
// import { paragraphMatches, getChildParas, getIndentedNonTaskLinesUnderPara, removeParentsWhoAreChildren } from '../NPParagraph'
77
import { Calendar, Clipboard, CommandBar, DataStore, Editor, NotePlan, Note, Paragraph, simpleFormatter } from '@mocks/index'
88
import { SCHEDULED_MONTH_NOTE_LINK } from '@helpers/dateTime'
99

np.Tidy/__tests__/topLevelTasks.test.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1+
// @flow
12
/* eslint-disable no-unused-vars */
23
/* eslint-disable import/order */
34
/* global jest, it, describe, test, expect, beforeAll, afterAll, beforeEach, afterEach */
45
import * as f from '../src/topLevelTasks.js'
56
import { CustomConsole, LogType, LogMessage } from '@jest/console' // see note below
67
import { Calendar, Clipboard, CommandBar, DataStore, Editor, Note, NotePlan, simpleFormatter /* Note, mockWasCalledWithString, Paragraph */ } from '@mocks/index'
78
import * as NPParagraph from '@helpers/NPParagraph'
9+
import * as ParentsAndChildren from '@helpers/ParentsAndChildren'
810

911
const PLUGIN_NAME = `np.Tidy`
1012
const FILENAME = `topLevelTasks.js`
@@ -212,7 +214,7 @@ describe(`${PLUGIN_NAME}`, () => {
212214
// Mock getParagraphParentsOnly to ensure results are consistent
213215
// it is tested elsewhere
214216
beforeEach(() => {
215-
jest.spyOn(NPParagraph, 'getParagraphParentsOnly').mockImplementation((paragraphs: TParagraph[]) => {
217+
jest.spyOn(ParentsAndChildren, 'getParagraphParentsOnly').mockImplementation((paragraphs: TParagraph[]) => {
216218
return paragraphs.map((para) => ({ parent: para, children: para.children || [] }))
217219
})
218220
})

0 commit comments

Comments
 (0)