Skip to content

Commit

Permalink
fix: format backend spec, update caniuse-lite
Browse files Browse the repository at this point in the history
  • Loading branch information
martinjagodic committed Aug 2, 2024
1 parent ec463e5 commit 1185790
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 19 deletions.
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 18 additions & 16 deletions packages/decap-cms-core/src/__tests__/backend.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -327,27 +327,28 @@ describe('Backend', () => {

const config = {
backend: {
commit_messages:"commit-messages"
} };
commit_messages: 'commit-messages',
},
};
const collection = Map({
name: 'posts',
});
const entry = Map({
data: 'old_data'
data: 'old_data',
});
const newEntry = Map({
data: 'new_data'
data: 'new_data',
});
const entryDraft = Map({
entry
entry,
});
const user = { login: 'login', name: 'name' };
const backend = new Backend(implementation, { config, backendName: 'github' });
backend.currentUser = jest.fn().mockResolvedValue(user);

backend.currentUser = jest.fn().mockResolvedValue(user);
backend.entryToRaw = jest.fn().mockReturnValue('content');
backend.invokePreSaveEvent = jest.fn().mockReturnValueOnce(newEntry);

await backend.persistEntry({ config, collection, entryDraft });

expect(backend.entryToRaw).toHaveBeenCalledTimes(1);
Expand All @@ -362,28 +363,29 @@ describe('Backend', () => {

const config = {
backend: {
commit_messages:"commit-messages"
} };
commit_messages: 'commit-messages',
},
};
const collection = Map({
name: 'posts',
});
const entry = Map({
data: Map({})
data: Map({}),
});
const newData = Map({});
const newEntry = Map({
data: newData
data: newData,
});
const entryDraft = Map({
entry
entry,
});
const user = { login: 'login', name: 'name' };
const backend = new Backend(implementation, { config, backendName: 'github' });
backend.currentUser = jest.fn().mockResolvedValue(user);

backend.currentUser = jest.fn().mockResolvedValue(user);
backend.entryToRaw = jest.fn().mockReturnValue('content');
backend.invokePreSaveEvent = jest.fn().mockReturnValueOnce(newData);

await backend.persistEntry({ config, collection, entryDraft });

expect(backend.entryToRaw).toHaveBeenCalledTimes(1);
Expand Down

0 comments on commit 1185790

Please sign in to comment.