|
12 | 12 | * a stray `managedBy` (an old stored row) must not move the answer. |
13 | 13 | * |
14 | 14 | * Both sites are pinned: the routed page's badge, and the Studio Access |
15 | | - * pillar's kind chip (`studio`). They read one derivation, so they agree. |
| 15 | + * pillar's kind chip (`studio`). They read one derivation, so they agree; the |
| 16 | + * Studio chip words the package answer for the builder (objectstack#35018: |
| 17 | + * "Included with the app"), the page keeps "Package". |
16 | 18 | */ |
17 | 19 |
|
18 | 20 | import '@testing-library/jest-dom/vitest'; |
| 21 | +// The source under test reaches these through dynamic imports: their first load is paid at collection. |
| 22 | +import '@objectstack/formula'; |
| 23 | +import '@objectstack/lint'; |
| 24 | +import '@objectstack/spec/identity'; |
19 | 25 | import { describe, it, expect, vi, afterEach } from 'vitest'; |
20 | 26 | import { render, screen, cleanup } from '@testing-library/react'; |
21 | 27 | import { MemoryRouter } from 'react-router-dom'; |
@@ -88,17 +94,19 @@ async function renderWith(site: Site, extra: Record<string, unknown>, packageId? |
88 | 94 | } |
89 | 95 |
|
90 | 96 | const badgeText = () => screen.getByTestId('perm-provenance-badge').textContent; |
| 97 | +/** The package answer as each site words it (objectstack#35018). */ |
| 98 | +const PACKAGE_TEXT: Record<Site, string> = { page: 'Package', studio: 'Included with the app' }; |
91 | 99 |
|
92 | 100 | describe.each<Site>(['page', 'studio'])('the provenance badge (%s site)', (site) => { |
93 | 101 | it('a set opened under a packageId reads "Package"', async () => { |
94 | 102 | await renderWith(site, {}, 'com.example.sales'); |
95 | | - expect(badgeText()).toBe('Package'); |
| 103 | + expect(badgeText()).toBe(PACKAGE_TEXT[site]); |
96 | 104 | }); |
97 | 105 |
|
98 | 106 | it('a set whose code layer is a package artifact reads "Package"', async () => { |
99 | 107 | codeLayer = { _packageId: 'com.example.sales', name: 'sales_perms' }; |
100 | 108 | await renderWith(site, {}); |
101 | | - expect(badgeText()).toBe('Package'); |
| 109 | + expect(badgeText()).toBe(PACKAGE_TEXT[site]); |
102 | 110 | }); |
103 | 111 |
|
104 | 112 | it('a set with neither reads "Added"', async () => { |
|
0 commit comments