Skip to content

Commit 1e170f5

Browse files
authored
Fix spec (#61)
1 parent 0b2e46d commit 1e170f5

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

test/integration/dirty-tracking.test.ts

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,31 @@ import { sinon, expect, fetchMock } from "../test-helper"
22
import { Person, Author, Book } from "../fixtures"
33
import { IResultProxy } from "../../src/proxies/index"
44

5-
afterEach(() => {
6-
fetchMock.restore()
7-
})
8-
9-
let responsePayload = (firstName: string) => {
10-
return {
11-
data: {
12-
id: "1",
13-
type: "people",
14-
attributes: { firstName }
15-
}
16-
}
17-
}
18-
19-
beforeEach(() => {
20-
let url = "http://example.com/api/v1/authors"
21-
fetchMock.post(url, responsePayload('John'))
22-
fetchMock.put(`${url}/1`, responsePayload('Jake'))
23-
})
24-
255
// This is a Vue-specific test. Since isPersisted is already true,
266
// Vue will prevent the setter from firing. We cannot rely on
277
// side-effect behavior of model.isPersisted = true
288
// So, ensure we at least call reset() explicitly
299
describe("Dirty tracking", () => {
10+
let responsePayload = (firstName: string) => {
11+
return {
12+
data: {
13+
id: "1",
14+
type: "people",
15+
attributes: { firstName }
16+
}
17+
}
18+
}
19+
20+
afterEach(() => {
21+
fetchMock.restore()
22+
})
23+
24+
beforeEach(() => {
25+
let url = "http://example.com/api/v1/authors"
26+
fetchMock.post(url, responsePayload('John'))
27+
fetchMock.put(`${url}/1`, responsePayload('Jake'))
28+
})
29+
3030
describe("when persisted, dirty, updated", () => {
3131
it("calls reset()", async () => {
3232
let instance = new Author({ firstName: 'John' })

0 commit comments

Comments
 (0)