|
|
|
@ -62,6 +62,12 @@ describe("SubscribableDataset", () => { |
|
|
|
|
expect(callbackFunc).toBeCalledTimes(1); |
|
|
|
|
expect(callbackFunc.mock.calls[0][0].added.size).toBe(1); |
|
|
|
|
expect(callbackFunc.mock.calls[0][0].added.has(tomColorQuad)).toBe(true); |
|
|
|
|
expect(callbackFunc.mock.calls[0][1]).toEqual([ |
|
|
|
|
namedNode("http://example.org/cartoons#Tom"), |
|
|
|
|
null, |
|
|
|
|
null, |
|
|
|
|
null, |
|
|
|
|
]); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
it("Alerts when a node is removed", () => { |
|
|
|
@ -74,6 +80,12 @@ describe("SubscribableDataset", () => { |
|
|
|
|
expect(callbackFunc).toBeCalledTimes(1); |
|
|
|
|
expect(callbackFunc.mock.calls[0][0].removed.size).toBe(1); |
|
|
|
|
expect(callbackFunc.mock.calls[0][0].removed.has(tomTypeQuad)).toBe(true); |
|
|
|
|
expect(callbackFunc.mock.calls[0][1]).toEqual([ |
|
|
|
|
namedNode("http://example.org/cartoons#Tom"), |
|
|
|
|
null, |
|
|
|
|
null, |
|
|
|
|
null, |
|
|
|
|
]); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
it("Alerts when multiple quads are added", () => { |
|
|
|
@ -87,6 +99,12 @@ describe("SubscribableDataset", () => { |
|
|
|
|
expect(callbackFunc.mock.calls[0][0].added.size).toBe(2); |
|
|
|
|
expect(callbackFunc.mock.calls[0][0].added.has(lickyNameQuad)).toBe(true); |
|
|
|
|
expect(callbackFunc.mock.calls[0][0].added.has(lickyTypeQuad)).toBe(true); |
|
|
|
|
expect(callbackFunc.mock.calls[0][1]).toEqual([ |
|
|
|
|
namedNode("http://example.org/cartoons#Licky"), |
|
|
|
|
null, |
|
|
|
|
null, |
|
|
|
|
null, |
|
|
|
|
]); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
it("Alerts when bulk updated by only adding", () => { |
|
|
|
@ -105,6 +123,12 @@ describe("SubscribableDataset", () => { |
|
|
|
|
), |
|
|
|
|
).toBe(true); |
|
|
|
|
expect(callbackFuncLicky.mock.calls[0][0].removed).toBe(undefined); |
|
|
|
|
expect(callbackFuncLicky.mock.calls[0][1]).toEqual([ |
|
|
|
|
namedNode("http://example.org/cartoons#Licky"), |
|
|
|
|
null, |
|
|
|
|
null, |
|
|
|
|
null, |
|
|
|
|
]); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
it("Alerts when bulk updated by only removing", () => { |
|
|
|
@ -123,6 +147,12 @@ describe("SubscribableDataset", () => { |
|
|
|
|
), |
|
|
|
|
).toBe(true); |
|
|
|
|
expect(callbackFuncTom.mock.calls[0][0].added).toBe(undefined); |
|
|
|
|
expect(callbackFuncTom.mock.calls[0][1]).toEqual([ |
|
|
|
|
namedNode("http://example.org/cartoons#Tom"), |
|
|
|
|
null, |
|
|
|
|
null, |
|
|
|
|
null, |
|
|
|
|
]); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
it("Alerts when emit is called", () => { |
|
|
|
|