fix: use resolveBackend instead of currentBackend (#3514)

This commit is contained in:
Erez Rokah 2020-04-01 14:05:02 +03:00 committed by GitHub
parent a1bf86e856
commit ea41b98324
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -4,7 +4,7 @@ import { applyDefaults, detectProxyServer, handleLocalBackend } from '../config'
jest.spyOn(console, 'log').mockImplementation(() => {});
jest.mock('coreSrc/backend', () => {
return {
currentBackend: jest.fn(() => ({ isGitBackend: jest.fn(() => true) })),
resolveBackend: jest.fn(() => ({ isGitBackend: jest.fn(() => true) })),
};
});

View File

@ -5,7 +5,7 @@ import { authenticateUser } from 'Actions/auth';
import * as publishModes from 'Constants/publishModes';
import { validateConfig } from 'Constants/configSchema';
import { selectDefaultSortableFields } from '../reducers/collections';
import { currentBackend } from 'coreSrc/backend';
import { resolveBackend } from 'coreSrc/backend';
export const CONFIG_REQUEST = 'CONFIG_REQUEST';
export const CONFIG_SUCCESS = 'CONFIG_SUCCESS';
@ -87,7 +87,7 @@ export function applyDefaults(config) {
}
if (!collection.has('sortableFields')) {
const backend = currentBackend(config);
const backend = resolveBackend(config);
const defaultSortable = selectDefaultSortableFields(collection, backend);
collection = collection.set('sortableFields', fromJS(defaultSortable));
}