Files
formipay/node_modules/tsconfig-paths/lib/__tests__/filesystem.test.js
dwindown e8fbfb14c1 fix: prevent asset conflicts between React and Grid.js versions
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>
2026-04-18 17:02:14 +07:00

64 lines
2.3 KiB
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var Filesystem = require("../filesystem");
var path = require("path");
describe("filesystem", function () {
var fileThatExists = path.join(__dirname, "../../package.json");
var fileThatNotExists = path.join(__dirname, "../../package2.json");
it("should find file that exists, sync", function () {
var result = Filesystem.fileExistsSync(fileThatExists);
// assert.equal(result, true);
expect(result).toBe(true);
});
it("should not find file that not exists, sync", function () {
var result = Filesystem.fileExistsSync(fileThatNotExists);
// assert.equal(result, false);
expect(result).toBe(false);
});
it("should find file that exists, async", function (done) {
Filesystem.fileExistsAsync(fileThatExists, function (_err, result) {
try {
// assert.equal(result, true);
expect(result).toBe(true);
done();
}
catch (error) {
done(error);
}
});
});
it("should not find file that not exists, async", function (done) {
Filesystem.fileExistsAsync(fileThatNotExists, function (_err, result) {
try {
// assert.equal(result, false);
expect(result).toBe(false);
done();
}
catch (error) {
done(error);
}
});
});
it("should load json, sync", function () {
var result = Filesystem.readJsonFromDiskSync(fileThatExists);
// assert.isOk(result);
expect(result);
// assert.equal(result.main, "lib/index.js");
expect(result.main).toBe("lib/index.js");
});
it("should load json, async", function (done) {
Filesystem.readJsonFromDiskAsync(fileThatExists, function (_err, result) {
try {
// assert.isOk(result); // Asserts that object is truthy.
expect(result).toBeTruthy();
// assert.equal(result.main, "lib/index.js");
expect(result.main).toBe("lib/index.js");
done();
}
catch (error) {
done(error);
}
});
});
});
//# sourceMappingURL=filesystem.test.js.map