changed from Inline snapshots to snapshots in a file
ADD
test/unit/widgets/__snapshots__/peoplePicker.test.ts.snap
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`GroupBuilder.add runs: Promise {} 1`] = `Promise {}`;
+
+exports[`GroupBuilder.handleRemove runs: [Function] 1`] = `[Function]`;
+
+exports[`GroupBuilder.render runs:
+GroupBuilder {
+ "book": Object {
+ "dir": [Function],
+ "doc": [Function],
+ "elements": Array [],
+ "sameTerm": [Function],
+ "uri": "uri",
+ "value": "",
+ },
+ "doneBuildingCb": [Function],
+ "element": <p>
+ <div
+ style="max-width: 350px; min-height: 200px; outline: 1px solid black; display: flex; flex-direction: column;"
+ >
+ <label>
+ Group Name:
+ <input
+ type="text"
+ />
+ </label>
+ <button>
+ Done
+ </button>
+ </div>
+ </p>,
+ "group": Object {
+ "dir": [Function],
+ "doc": [Function],
+ "elements": Array [],
+ "sameTerm": [Function],
+ "uri": "uri",
+ "value": "",
+ },
+ "groupChangedCb": [Function],
+ "onGroupChanged": [Function],
+}
+ 1`] = `
+GroupBuilder {
+ "book": Object {
+ "dir": [Function],
+ "doc": [Function],
+ "elements": Array [],
+ "sameTerm": [Function],
+ "uri": "uri",
+ "value": "",
+ },
+ "doneBuildingCb": [Function],
+ "element": <p>
+ <div
+ style="max-width: 350px; min-height: 200px; outline: 1px solid black; display: flex; flex-direction: column;"
+ >
+ <label>
+ Group Name:
+ <input
+ type="text"
+ />
+ </label>
+ <button>
+ Done
+ </button>
+ </div>
+ </p>,
+ "group": Object {
+ "dir": [Function],
+ "doc": [Function],
+ "elements": Array [],
+ "sameTerm": [Function],
+ "uri": "uri",
+ "value": "",
+ },
+ "groupChangedCb": [Function],
+ "onGroupChanged": [Function],
+}
+`;
+
+exports[`GroupBuilder.setGroupName runs: Promise {} 1`] = `Promise {}`;
+
+exports[`PeoplePicker.render .. type index ...:
+ PeoplePicker {
+ "element": <p>
+ <div
+ style="max-width: 350px; min-height: 200px; outline: 1px solid black; display: flex;"
+ />
+ </p>,
+ "groupPickedCb": [Function],
+ "onSelectGroup": [Function],
+ "options": Object {
+ "selectedGroup": Object {},
+ },
+ "selectedgroup": undefined,
+ "typeIndex": "publicTypeIndex",
+ }
+ 1`] = `
+PeoplePicker {
+ "element": <p>
+ <div
+ style="max-width: 350px; min-height: 200px; outline: 1px solid black; display: flex;"
+ />
+ </p>,
+ "findAddressBook": [Function],
+ "groupPickedCb": [Function],
+ "onSelectGroup": [Function],
+ "options": Object {
+ "selectedGroup": Object {},
+ },
+ "selectedgroup": undefined,
+ "typeIndex": "publicTypeIndex",
+}
+`;
+
+exports[`PeoplePicker.render mocking kb any for book:
+PeoplePicker {
+ "element": <p>
+ <div
+ style="max-width: 350px; min-height: 200px; outline: 1px solid black; display: flex;"
+ />
+ </p>,
+ "groupPickedCb": [Function],
+ "onSelectGroup": [Function],
+ "options": Object {
+ "selectedGroup": true,
+ },
+ "selectedgroup": undefined,
+ "typeIndex": Object {},
+}
+ 1`] = `
+PeoplePicker {
+ "element": <p>
+ <div
+ style="max-width: 350px; min-height: 200px; outline: 1px solid black; display: flex;"
+ />
+ </p>,
+ "findAddressBook": [Function],
+ "groupPickedCb": [Function],
+ "onSelectGroup": [Function],
+ "options": Object {
+ "selectedGroup": true,
+ },
+ "selectedgroup": undefined,
+ "typeIndex": Object {},
+}
+`;
+
+exports[`PeoplePicker.render runs 2:
+ PeoplePicker {
+ "element": <p>
+ <div
+ style="max-width: 350px; min-height: 200px; outline: 1px solid black; display: flex;"
+ />
+ </p>,
+ "groupPickedCb": [Function],
+ "onSelectGroup": [Function],
+ "options": Object {
+ "selectedGroup": true,
+ },
+ "selectedgroup": undefined,
+ "typeIndex": Object {},
+ }
+ 1`] = `
+PeoplePicker {
+ "element": <p>
+ <div
+ style="max-width: 350px; min-height: 200px; outline: 1px solid black; display: flex;"
+ />
+ </p>,
+ "findAddressBook": [Function],
+ "groupPickedCb": [Function],
+ "onSelectGroup": [Function],
+ "options": Object {
+ "selectedGroup": true,
+ },
+ "selectedgroup": undefined,
+ "typeIndex": Object {},
+}
+`;
+
+exports[`PeoplePicker.render runs:
+ PeoplePicker {
+ "element": <p>
+ <div
+ style="max-width: 350px; min-height: 200px; outline: 1px solid black; display: flex;"
+ />
+ </p>,
+ "groupPickedCb": [Function],
+ "onSelectGroup": [Function],
+ "options": Object {
+ "selectedGroup": false,
+ },
+ "selectedgroup": undefined,
+ "typeIndex": Object {},
+ }
+ 1`] = `
+PeoplePicker {
+ "element": <p>
+ <div
+ style="max-width: 350px; min-height: 200px; outline: 1px solid black; display: flex;"
+ />
+ </p>,
+ "findAddressBook": [Function],
+ "groupPickedCb": [Function],
+ "onSelectGroup": [Function],
+ "options": Object {
+ "selectedGroup": false,
+ },
+ "selectedgroup": undefined,
+ "typeIndex": Object {},
+}
+`;
+
+exports[`Person.render runs:
+Person {
+ "element": <div>
+ <div
+ style="display: flex;"
+ >
+ <img
+ height="50"
+ src="undefined"
+ style="margin: 5px;"
+ width="50"
+ />
+ <span
+ style="flex-grow: 1; margin: auto 0px;"
+ >
+ undefined
+ </span>
+ <button
+ style="margin: 5px;"
+ >
+ Remove
+ </button>
+ </div>
+ </div>,
+ "handleRemove": true,
+ "webIdNode": <div />,
+}
+ 1`] = `
+Person {
+ "element": <div>
+ <div
+ style="display: flex;"
+ >
+ <img
+ height="50"
+ src="undefined"
+ style="margin: 5px;"
+ width="50"
+ />
+ <span
+ style="flex-grow: 1; margin: auto 0px;"
+ >
+ undefined
+ </span>
+ <button
+ style="margin: 5px;"
+ >
+ Remove
+ </button>
+ </div>
+ </div>,
+ "handleRemove": true,
+ "webIdNode": <div />,
+}
+`;

MODIFY
test/unit/widgets/peoplePicker.test.ts
test/unit/widgets/peoplePicker.test.ts
@@ -114,8 +114,8 @@ describe('PeoplePicker.render', () => {
it('exists', () => {
expect(new PeoplePicker().render).toBeInstanceOf(Function)
})
- // skipping snapshots for now until decision is made about prettier
- it.skip('runs', () => {
+
+ it('runs', () => {
const typeIndex = {}
const groupPickedCb = () => { }
const options = { selectedGroup: false }
@@ -126,7 +126,7 @@ describe('PeoplePicker.render', () => {
groupPickedCb,
options
)
- expect(peoplePicker.render()).toMatchInlineSnapshot(`
+ expect(peoplePicker.render()).toMatchSnapshot(`
PeoplePicker {
"element": <p>
<div
@@ -143,8 +143,8 @@ describe('PeoplePicker.render', () => {
}
`)
})
- // skipping snapshots for now until decision is made about prettier
- it.skip('.. type index ...', () => {
+
+ it('.. type index ...', () => {
const typeIndex = 'publicTypeIndex'
const groupPickedCb = () => { }
const options = { selectedGroup: {} }
@@ -170,7 +170,7 @@ describe('PeoplePicker.render', () => {
// expect(spySecondAny).toBeCalled()
// expect(spyLoad).toBeCalled()
- expect(peoplePicker.render()).toMatchInlineSnapshot(`
+ expect(peoplePicker.render()).toMatchSnapshot(`
PeoplePicker {
"element": <p>
<div
@@ -205,7 +205,7 @@ describe('PeoplePicker.render', () => {
expect(spy).toHaveBeenCalledTimes(2)
})
// skipping snapshots for now until decision is made about prettier
- it.skip('runs 2', () => {
+ it('runs 2', () => {
const typeIndex = {}
const groupPickedCb = () => { }
const options = { selectedGroup: true }
@@ -216,7 +216,7 @@ describe('PeoplePicker.render', () => {
groupPickedCb,
options
)
- expect(peoplePicker.render()).toMatchInlineSnapshot(`
+ expect(peoplePicker.render()).toMatchSnapshot(`
PeoplePicker {
"element": <p>
<div
@@ -233,7 +233,7 @@ describe('PeoplePicker.render', () => {
}
`)
})
- it.skip('mocking kb any for book', () => {
+ it('mocking kb any for book', () => {
const mockKbAny: jest.SpyInstance = require('../../../src/store').any
mockKbAny.mockReturnValueOnce(null)
const typeIndex = {}
@@ -246,7 +246,7 @@ describe('PeoplePicker.render', () => {
groupPickedCb,
options
)
- expect(peoplePicker.render()).toMatchInlineSnapshot(`
+ expect(peoplePicker.render()).toMatchSnapshot(`
PeoplePicker {
"element": <p>
<div
@@ -409,8 +409,8 @@ describe('GroupBuilder.render', () => {
it('exists', () => {
expect(new GroupBuilder().render).toBeInstanceOf(Function)
})
- // skipping snapshots for now until decision is made about prettier
- it.skip('runs', () => {
+
+ it('runs', () => {
jest.clearAllMocks()
const groupArg = RdfLib.sym('')
const book = RdfLib.sym('')
@@ -426,7 +426,7 @@ describe('GroupBuilder.render', () => {
// @@ TODO just trying to touch the code at this point. I want
// to make the test better than toBe(undefined)
expect(groupBuilder.onGroupChanged()).toBe(undefined)
- expect(groupBuilder.render()).toMatchInlineSnapshot(`
+ expect(groupBuilder.render()).toMatchSnapshot(`
GroupBuilder {
"book": Object {
"dir": [Function],
@@ -501,7 +501,7 @@ describe('GroupBuilder.add', () => {
handler,
handler
)
- expect(groupBuilder.add()).toMatchInlineSnapshot(`Promise {}`)
+ expect(groupBuilder.add()).toMatchSnapshot(`Promise {}`)
})
// need to to nowOrWhenFetched
it('not okay it returns an error -- callback false', () => {
@@ -554,8 +554,8 @@ describe('GroupBuilder.handleRemove', () => {
it('exists', () => {
expect(new GroupBuilder().handleRemove).toBeInstanceOf(Function)
})
- // skipping snapshots for now until decision is made about prettier
- it.skip('runs', () => {
+
+ it('runs', () => {
const groupArg = RdfLib.sym('')
const book = RdfLib.sym('')
const handler = () => { }
@@ -567,7 +567,7 @@ describe('GroupBuilder.handleRemove', () => {
handler,
handler
)
- expect(groupBuilder.handleRemove()).toMatchInlineSnapshot('[Function]')
+ expect(groupBuilder.handleRemove()).toMatchSnapshot('[Function]')
})
})
@@ -578,7 +578,7 @@ describe('GroupBuilder.setGroupName', () => {
// @@ TODO once I added the code for findAddressBook, a namedGraph
// error is popping up on line 392 Need to look into this
// think groupArg may need to be adjusted
- it.skip('runs', () => {
+ it('runs', () => {
const groupArg = RdfLib.sym('testing')
const book = RdfLib.sym('')
const handler = () => { }
@@ -590,7 +590,7 @@ describe('GroupBuilder.setGroupName', () => {
handler,
handler
)
- expect(groupBuilder.setGroupName()).toMatchInlineSnapshot('Promise {}')
+ expect(groupBuilder.setGroupName()).toMatchSnapshot('Promise {}')
})
})
@@ -603,14 +603,14 @@ describe('Person.render', () => {
it('exists', () => {
expect(new Person().render).toBeInstanceOf(Function)
})
- // skipping snapshots for now until decision is made about prettier
- it.skip('runs', () => {
+
+ it('runs', () => {
// @@ TODO Ask Michiel or Vince about what a proper WebIdNode should be
const webIdNode = document.createElement('div')
const element = document.createElement('div')
const handleRemove = true
const person = new Person(webIdNode, element, handleRemove)
- expect(person.render()).toMatchInlineSnapshot(`
+ expect(person.render()).toMatchSnapshot(`
Person {
"element": <div>
<div

changed from Inline snapshots to snapshots in a file