Add coexistence checks to all enqueue methods to prevent loading both React and Grid.js assets simultaneously. Changes: - ReactAdmin.php: Only enqueue React assets when ?react=1 - Init.php: Skip Grid.js when React active on admin pages - Form.php, Coupon.php, Access.php: Restore classic assets when ?react=0 - Customer.php, Product.php, License.php: Add coexistence checks Now the toggle between Classic and React versions works correctly. Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
44 lines
2.1 KiB
TypeScript
44 lines
2.1 KiB
TypeScript
import getParser from '../../src/parser/index.js';
|
|
import inspect from '../../src/stringifier/inspect.js';
|
|
import { seedBlock } from '../../src/util.js';
|
|
|
|
test('multiple lines', () => {
|
|
const source = `
|
|
/**
|
|
* Description may go\r\r
|
|
* over few lines followed by @tags\r
|
|
* @param {string} name name parameter
|
|
* @param {any} value value of any type
|
|
*/`.slice(1);
|
|
|
|
const parsed = getParser()(source);
|
|
const expected = `
|
|
|line|start|delimiter|postDelimiter|tag |postTag|name |postName|type |postType|description |end|CR |
|
|
|----|-----|---------|-------------|------|-------|-----|--------|--------|--------|--------------------------------|---|---|
|
|
| 0|{2} |/** | | | | | | | | | | |
|
|
| 1|{3} |* |{1} | | | | | | |Description may go | |{2}|
|
|
| 2|{3} |* |{1} | | | | | | |over few lines followed by @tags| |{1}|
|
|
| 3|{3} |* |{1} |@param|{1} |name |{1} |{string}|{1} |name parameter | | |
|
|
| 4|{3} |* |{1} |@param|{1} |value|{1} |{any} |{1} |value of any type | | |
|
|
| 5|{3} | | | | | | | | | |*/ | |`;
|
|
|
|
expect(inspect(parsed[0])).toEqual(expected.slice(1));
|
|
});
|
|
|
|
test('single line', () => {
|
|
const source = '/** @param {string} name name parameter */';
|
|
const parsed = getParser({ startLine: 12345 })(source);
|
|
const expected = `
|
|
|line |start|delimiter|postDelimiter|tag |postTag|name|postName|type |postType|description |end|CR|
|
|
|-----|-----|---------|-------------|------|-------|----|--------|--------|--------|---------------|---|--|
|
|
|12345| |/** |{1} |@param|{1} |name|{1} |{string}|{1} |name parameter |*/ | |`;
|
|
|
|
expect(inspect(parsed[0])).toEqual(expected.slice(1));
|
|
});
|
|
|
|
test('empty', () => {
|
|
const expected = '';
|
|
|
|
expect(inspect(seedBlock())).toEqual(expected.slice(1));
|
|
});
|