Skip to content

Commit 963c240

Browse files
committed
test(rsc-mf): require action-family union coverage for posted ids
1 parent 0c0ca33 commit 963c240

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

tests/integration/rsc-mf/tests/index.test.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,11 @@ async function renderRemoteRscIntoHost({ hostPort, page }: TestContext) {
214214
?.split(',')
215215
.filter(Boolean) as string[];
216216
expect(hostIncrementProxyActionIdList.length).toBeGreaterThan(0);
217+
expect(
218+
hostIncrementProxyActionIdList.every(id =>
219+
hostProxyActionIdList.includes(id),
220+
),
221+
).toBe(true);
217222
const hostEchoProxyActionIds = await page.$eval(
218223
'.host-echo-proxy-action-ids',
219224
el => el.textContent?.trim(),
@@ -222,6 +227,9 @@ async function renderRemoteRscIntoHost({ hostPort, page }: TestContext) {
222227
?.split(',')
223228
.filter(Boolean) as string[];
224229
expect(hostEchoProxyActionIdList.length).toBeGreaterThan(0);
230+
expect(
231+
hostEchoProxyActionIdList.every(id => hostProxyActionIdList.includes(id)),
232+
).toBe(true);
225233
const hostNestedProxyActionIds = await page.$eval(
226234
'.host-nested-proxy-action-ids',
227235
el => el.textContent?.trim(),
@@ -230,6 +238,9 @@ async function renderRemoteRscIntoHost({ hostPort, page }: TestContext) {
230238
?.split(',')
231239
.filter(Boolean) as string[];
232240
expect(hostNestedProxyActionIdList.length).toBeGreaterThan(0);
241+
expect(
242+
hostNestedProxyActionIdList.every(id => hostProxyActionIdList.includes(id)),
243+
).toBe(true);
233244
const hostDefaultProxyActionIds = await page.$eval(
234245
'.host-default-proxy-action-ids',
235246
el => el.textContent?.trim(),
@@ -238,6 +249,11 @@ async function renderRemoteRscIntoHost({ hostPort, page }: TestContext) {
238249
?.split(',')
239250
.filter(Boolean) as string[];
240251
expect(hostDefaultProxyActionIdList.length).toBeGreaterThan(0);
252+
expect(
253+
hostDefaultProxyActionIdList.every(id =>
254+
hostProxyActionIdList.includes(id),
255+
),
256+
).toBe(true);
241257
const groupedProxyActionIdUnion = new Set([
242258
...hostDirectProxyActionIdList,
243259
...hostBundledProxyActionIdList,
@@ -605,6 +621,12 @@ function runTests({ mode }: TestConfig) {
605621
.split(',')
606622
.filter(Boolean),
607623
);
624+
const actionFamilyProxyActionIdSet = new Set([
625+
...incrementProxyActionIdSet,
626+
...echoProxyActionIdSet,
627+
...nestedProxyActionIdSet,
628+
...defaultProxyActionIdSet,
629+
]);
608630
expect(usesDirectProxyIds || usesBundledProxyIds).toBe(true);
609631
if (!usesDirectProxyIds || !usesBundledProxyIds) {
610632
expect(hostProxyMapCollisionCount).toBeGreaterThan(0);
@@ -621,6 +643,9 @@ function runTests({ mode }: TestConfig) {
621643
expect(actionRequestIds.some(id => defaultProxyActionIdSet.has(id))).toBe(
622644
true,
623645
);
646+
expect(
647+
actionRequestIds.every(id => actionFamilyProxyActionIdSet.has(id)),
648+
).toBe(true);
624649
expect(
625650
actionRequestIds.every(
626651
id =>

0 commit comments

Comments
 (0)