The Unified and Autonomous Development Platform
fix: Ensure Select2 plugin is properly reloaded in e2e tests
Robin Shen2d624a90eab5
diff --git a/e2e-test/tests/select2.spec.js b/e2e-test/tests/select2.spec.jsindex ba286d9643..4ad0767f8b 100644--- a/e2e-test/tests/select2.spec.js+++ b/e2e-test/tests/select2.spec.js@@ -21,6 +21,9 @@ test.beforeEach(async ({ page }) => {await page.addStyleTag({ path: path.join(resources, 'select2.css') });await page.addStyleTag({ path: path.join(resources, 'select2-bootstrap.css') });await page.addScriptTag({ path: path.join(webRoot, 'asset/jqueryui/jquery-ui.min.js') });+ // Production's login bundle already includes Select2. Reloading it retains+ // the old plugin but replaces its AMD modules, splitting the data cache.+ await page.evaluate(() => { delete $.fn.select2; });await page.addScriptTag({ path: path.join(resources, 'select2.js') });await page.addScriptTag({ path: path.join(resources, 'select2-integration.js') });});