Remove demo workspace and restore formal account access
This commit is contained in:
1 parent
efa982a8a1
commit
23e28a7dcb
15 files changed
+79
-171
No files matched your search
@@ -8,7 +8,7 @@ const {Store}=require('../../src/modules/dashboard/store.cjs');
|
||||
const {createDashboard}=require('../../src/app/dashboard.cjs');
|
||||
const {RuleStore}=require('../../src/modules/order-rules/store.cjs');
|
||||
const {loadPlaywright,browserOptions}=require('../../src/platform/browser.cjs');
|
||||
const {startPreview}=require('../../scripts/preview.cjs');
|
||||
const {startTestDashboard,login}=require('../fixtures/dashboard-runtime.cjs');
|
||||
|
||||
test('category editor saves/reloads drafts, previews readable evidence without ingesting, and gates execution',{timeout:90000},async t=>{
|
||||
const dir=await fs.mkdtemp(path.join(os.tmpdir(),'order-rules-web-')),store=new Store(path.join(dir,'users'));
|
||||
@@ -38,8 +38,8 @@ test('category editor saves/reloads drafts, previews readable evidence without i
|
||||
await page.setViewportSize({width:390,height:844});assert.equal(await page.evaluate(()=>document.documentElement.scrollWidth<=innerWidth),true);assert.deepEqual(errors,[]);
|
||||
});
|
||||
|
||||
test('isolated preview offers a direct entry button and opens category rules without credentials',{timeout:60000},async t=>{
|
||||
const dir=await fs.mkdtemp(path.join(os.tmpdir(),'order-rules-preview-web-'));const runtime=await startPreview({stateDir:dir,port:0});let browser;t.after(async()=>{await browser?.close();runtime.server.closeAllConnections();await runtime.close();await fs.rm(dir,{recursive:true,force:true});});browser=await loadPlaywright().chromium.launch(browserOptions());const page=await browser.newPage();await page.goto('http://127.0.0.1:'+runtime.server.address().port+'/#order-rules');await page.getByRole('button',{name:'进入演示空间',exact:true}).click();await page.getByRole('button',{name:'通知规则',exact:true}).click();await page.getByText('Excel 分类 · 15',{exact:true}).waitFor();assert.equal(runtime.orderRules.snapshot().orders.length,0);assert.equal(await page.getByLabel('规则名称',{exact:true}).isEnabled(),true);
|
||||
test('ordinary admin login opens all category rules without a demo entry',{timeout:60000},async t=>{
|
||||
const dir=await fs.mkdtemp(path.join(os.tmpdir(),'order-rules-preview-web-'));const runtime=await startTestDashboard({stateDir:dir});let browser;t.after(async()=>{await browser?.close();runtime.server.closeAllConnections();await runtime.close();await fs.rm(dir,{recursive:true,force:true});});browser=await loadPlaywright().chromium.launch(browserOptions());const page=await browser.newPage();await page.goto('http://127.0.0.1:'+runtime.server.address().port+'/#order-rules');assert.equal(await page.getByRole('button',{name:'进入演示空间',exact:true}).count(),0);await login(page);await page.getByRole('button',{name:'通知规则',exact:true}).click();await page.getByText('Excel 分类 · 15',{exact:true}).waitFor();assert.equal(runtime.orderRules.snapshot().orders.length,0);assert.equal(await page.getByLabel('规则名称',{exact:true}).isEnabled(),true);
|
||||
});
|
||||
|
||||
test('real catalog workflow publishes a saved and sampled draft while roles and production gates remain enforced',{timeout:90000},async t=>{
|
||||
|
||||
Reference in new issue
Block a user