test(10.1-04): cover the Phase 10.1 extension point Go code
- acme fixture plugin under modules/cabana/testdata/extension (gadgets controller, header and form partials, lookup widget, JS and CSS) - TestPhase101FormExtensionSchema, TestPhase101PartialSchema and TestPhase101Toolbar: every widget, partial and toolbar boot rule - TestPhase101PartialSanitizer: tag, attribute and URL allowlist, escaping, per-request trans, size/node/depth caps and the view-model guard - TestPhase101Assets: exact-key asset hits, revalidation, SPA fall-through, boot path checks and ?v= schema URLs - TestPhase101Actions (PostgreSQL): scoping, fill filter, strict body, action permission, error mapping, CSRF header, toolbar and partial routes - TestPhase101BoardwalkExports: ContentType and SetSecurityHeaders
This commit is contained in:
4
modules/cabana/testdata/extension/assets/css/gadgets.css
vendored
Normal file
4
modules/cabana/testdata/extension/assets/css/gadgets.css
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
acme-demo-lookup button {
|
||||
font: inherit;
|
||||
color: var(--c-text);
|
||||
}
|
||||
18
modules/cabana/testdata/extension/assets/js/lookup.js
vendored
Normal file
18
modules/cabana/testdata/extension/assets/js/lookup.js
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
// A plain custom element: one light-DOM button that asks the admin SPA to
|
||||
// run the field's action. It makes no request and reads no cookie or
|
||||
// storage; the SPA owns HTTP.
|
||||
class AcmeDemoLookup extends HTMLElement {
|
||||
connectedCallback() {
|
||||
if (this.firstChild) return
|
||||
const button = document.createElement('button')
|
||||
button.type = 'button'
|
||||
button.textContent = this.getAttribute('label') || ''
|
||||
button.addEventListener('click', () => {
|
||||
this.dispatchEvent(new CustomEvent('summer-action', { bubbles: true, composed: true }))
|
||||
})
|
||||
this.append(button)
|
||||
}
|
||||
}
|
||||
if (!customElements.get('acme-demo-lookup')) {
|
||||
customElements.define('acme-demo-lookup', AcmeDemoLookup)
|
||||
}
|
||||
Reference in New Issue
Block a user