feat(blog): enable live likes and first-party views

This commit is contained in:
DeCentN2Madness authored and AIAMarketing committed 2026-11-06 10:54:18 -07:00
1 parent 89cdb00765
commit 8c19266760
13 files changed
+631 -30

No files matched your search

+14
View File
@@ -110,6 +110,19 @@ test('artifact rejects production API origin even when Form A is approved', asyn
assert.ok(result.errors.some((error) => error.includes('unsafe artifact signals')));
});
test('live counters allow only the reviewed API origin and explicit live mode', async () => {
const root = await fixture('indexing');
await fs.appendFile(path.join(root, 'index.html'), '<div data-counter data-counter-mode="live" data-api-base="https://api.azinstitute4autism.com"></div>');
assert.equal((await verifyArtifact(root, 'indexing', 'live', { mode: 'none' }, 'live')).passed, true);
assert.equal((await verifyArtifact(root, 'indexing', 'live', { mode: 'none' }, 'off')).passed, false);
const wrong = await fixture('indexing');
await fs.appendFile(path.join(wrong, 'index.html'), '<div data-counter data-counter-mode="live" data-api-base="https://other.invalid"></div>');
const result = await verifyArtifact(wrong, 'indexing', 'live', { mode: 'none' }, 'live');
assert.equal(result.passed, false);
assert.ok(result.errors.some((error) => error.includes('approved mode or API origin')));
});
test('artifact rejects Form A identity outside the exact approved HTML routes', async () => {
const root = await fixture('staging');
await fs.writeFile(path.join(root, 'assets.js'), 'https://form.jotform.com/262946078314059?formContext=contact');
@@ -182,4 +195,5 @@ test('artifact rejects extra routes, wrong origins and prematurely loaded drawer
test('obsolete artifact modes are rejected with separate publication/form guidance', async () => {
await assert.rejects(verifyArtifact('/unused','isolated-test'), /--forms=live\|off\|mock/);
await assert.rejects(verifyArtifact('/unused','staging','invalid'), /live, off, or mock/);
await assert.rejects(verifyArtifact('/unused','staging','live',{ mode: 'none' },'invalid'), /counters must be live/);
});