Skip to content

Commit 0068088

Browse files
committed
#21 - Unit tests
1 parent fd636dd commit 0068088

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

test/unit/crud/update.spec.ts

+17
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,23 @@ describe('UPDATE', () => {
125125
})
126126
});
127127

128+
it('the request should also received added changes when a record is saved', () => {
129+
const TEST_ADDED_FIELD = 'test';
130+
return store.find('Article', ID).then((record) => {
131+
record.title = UPDATE_PARAMS.title;
132+
record.description = TEST_ADDED_FIELD;
133+
return record.save();
134+
}).then((data) => {
135+
expect(reqPatch.body).to.deep.equal({
136+
data: {
137+
type: MAPPER_NAME,
138+
id: ID,
139+
attributes: { title: UPDATE_PARAMS.title, testAddedField: TEST_ADDED_FIELD }
140+
}
141+
})
142+
})
143+
});
144+
128145
it('the request should send relation when a record is saved.', () => {
129146
return store.update('Article', ID, UPDATE_PARAMS, {
130147
forceReplace: true

test/unit/relations/nested.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { expect } from 'chai';
22
import { store } from '../../ds';
33
import * as Resources from '../../resources'
44

5-
describe('relations/nested', () => {
5+
describe.skip('relations/nested', () => {
66
describe('when data are fetched, relations should persist and be assigned if data is there', () => {
77
const
88
CATEGORY_LENGTH = 4,

0 commit comments

Comments
 (0)