mirror of
https://github.com/morluto/rea.git
synced 2026-12-04 01:54:49 +00:00
test(web-bundle): reuse merged endpoint fixtures (#16064)
This commit is contained in:
1 parent
24021dbfa4
commit
a702a3478f
1 file changed
+6
-23
@@ -223,8 +223,8 @@ it("filters endpoints by values, script_keys, mechanisms, and field projections"
|
||||
expect(item.location).toMatchObject({ script_key: "vendor.js" });
|
||||
});
|
||||
|
||||
it("returns merged endpoint occurrences and script_keys on an unfiltered page", () => {
|
||||
const parent = makeParent({
|
||||
const mergedEndpointParent = (ordersScriptKey: string) =>
|
||||
makeParent({
|
||||
observations: {
|
||||
...sampleWebBundleAnalysis().observations,
|
||||
endpoints: [
|
||||
@@ -238,12 +238,14 @@ it("returns merged endpoint occurrences and script_keys on an unfiltered page",
|
||||
{
|
||||
value: "/api/orders",
|
||||
mechanism: "call:sendBeacon",
|
||||
location: { script_key: "app.js", line: 85, column: 4 },
|
||||
location: { script_key: ordersScriptKey, line: 85, column: 4 },
|
||||
},
|
||||
],
|
||||
},
|
||||
});
|
||||
|
||||
it("returns merged endpoint occurrences and script_keys on an unfiltered page", () => {
|
||||
const parent = mergedEndpointParent("app.js");
|
||||
const page = query(parent, {
|
||||
kind: "web-bundle",
|
||||
collection: "endpoints",
|
||||
@@ -268,26 +270,7 @@ it("returns merged endpoint occurrences and script_keys on an unfiltered page",
|
||||
});
|
||||
|
||||
it("matches a merged endpoint by any retained script key", () => {
|
||||
const parent = makeParent({
|
||||
observations: {
|
||||
...sampleWebBundleAnalysis().observations,
|
||||
endpoints: [
|
||||
{
|
||||
value: "/api/shared",
|
||||
mechanism: "call:fetch",
|
||||
location: { script_key: "app.js", line: 10, column: 2 },
|
||||
occurrences: 2,
|
||||
script_keys: ["app.js", "vendor.js"],
|
||||
},
|
||||
{
|
||||
value: "/api/orders",
|
||||
mechanism: "call:sendBeacon",
|
||||
location: { script_key: "vendor.js", line: 85, column: 4 },
|
||||
},
|
||||
],
|
||||
},
|
||||
});
|
||||
|
||||
const parent = mergedEndpointParent("vendor.js");
|
||||
const bySecondScript = query(parent, {
|
||||
kind: "web-bundle",
|
||||
collection: "endpoints",
|
||||
|
||||
Reference in new issue
Block a user