fix(engine): disable Sweetistics fallback when forcing graphql
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { resolveEngineMode, shouldUseSweetistics } from '../src/lib/engine.js';
|
||||
import { resolveEngineMode, shouldAllowSweetisticsFallback, shouldUseSweetistics } from '../src/lib/engine.js';
|
||||
|
||||
describe('engine', () => {
|
||||
it('normalizes engine values and defaults to auto', () => {
|
||||
@@ -19,4 +19,11 @@ describe('engine', () => {
|
||||
expect(shouldUseSweetistics('sweetistics', false)).toBe(true);
|
||||
expect(shouldUseSweetistics('graphql', true)).toBe(false);
|
||||
});
|
||||
|
||||
it('only allows Sweetistics fallback in auto mode', () => {
|
||||
expect(shouldAllowSweetisticsFallback('auto', true)).toBe(true);
|
||||
expect(shouldAllowSweetisticsFallback('auto', false)).toBe(false);
|
||||
expect(shouldAllowSweetisticsFallback('graphql', true)).toBe(false);
|
||||
expect(shouldAllowSweetisticsFallback('sweetistics', true)).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user