Beam

Matrix / Price inside a shadow root

Price inside a shadow root

Not runNot from a Kane issueMeasured on Kane 0.10.9 and 0.10.8

A custom <price-tag> element shows "Price: $49" inside its open shadow root. The broken page renders "Price: $94" inside the shadow root instead.

What your agent will do with Beam installed

Not measured yet.

Results

WordingKaneCorrect pageBroken pageResult
Verify the price shown is $49.Not run yet
Verify the exact visible text of the price tag is "Price: $49".Not run yet

The two pages

Correct page Kane should passOpen full page
Source
<!doctype html><html lang="en"><head><meta charset="utf-8"><title>store</title></head><body>
<h1>Store</h1>
<price-tag></price-tag>
<script>
  class PriceTag extends HTMLElement {
    constructor() {
      super();
      const root = this.attachShadow({ mode: 'open' });
      root.innerHTML = '<span class="price">Price: $49</span>';
    }
  }
  customElements.define('price-tag', PriceTag);
</script></body></html>
Broken page Kane should failOpen full page
Source
<!doctype html><html lang="en"><head><meta charset="utf-8"><title>store</title></head><body>
<h1>Store</h1>
<price-tag></price-tag>
<script>
  class PriceTag extends HTMLElement {
    constructor() {
      super();
      const root = this.attachShadow({ mode: 'open' });
      root.innerHTML = '<span class="price">Price: $94</span>';
    }
  }
  customElements.define('price-tag', PriceTag);
</script></body></html>

Reproduce it

Clone the repo, then run this behavior on your own Kane:

npm run suite -- shadow-dom-text