Skip to content

Commit 9906c0a

Browse files
committed
add e2e echos
1 parent bee6934 commit 9906c0a

File tree

1 file changed

+41
-18
lines changed

1 file changed

+41
-18
lines changed

site/e2e/helpers.ts

Lines changed: 41 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -562,6 +562,33 @@ const emptyPlan = new TextEncoder().encode("{}");
562562
const createTemplateVersionTar = async (
563563
responses: EchoProvisionerResponses = {},
564564
): Promise<Buffer> => {
565+
if (responses.graph) {
566+
if(!responses.apply) {
567+
responses.apply = responses.graph.map((response) => {
568+
if (response.log) {
569+
return response;
570+
}
571+
return {
572+
apply: {
573+
error: response.graph?.error ?? "",
574+
},
575+
};
576+
});
577+
}
578+
if(!responses.plan) {
579+
responses.plan = responses.graph.map((response) => {
580+
if (response.log) {
581+
return response;
582+
}
583+
return {
584+
plan: {
585+
error: response.graph?.error ?? "",
586+
},
587+
};
588+
});
589+
}
590+
}
591+
565592
if (!responses.init) {
566593
responses.init = [
567594
{
@@ -591,25 +618,11 @@ const createTemplateVersionTar = async (
591618
];
592619
}
593620
if (!responses.graph) {
594-
responses.graph = responses.apply.map((response) => {
595-
if (response.log) {
596-
return response;
621+
responses.graph = [
622+
{
623+
graph: {},
597624
}
598-
return {
599-
graph: {
600-
error: response.graph?.error ?? "",
601-
resources: response.graph?.resources ?? [],
602-
parameters: response.graph?.parameters ?? [],
603-
externalAuthProviders: response.graph?.externalAuthProviders ?? [],
604-
timings: response.graph?.timings ?? [],
605-
presets: [],
606-
resourceReplacements: [],
607-
plan: emptyPlan,
608-
moduleFiles: new Uint8Array(),
609-
moduleFilesHash: new Uint8Array(),
610-
},
611-
};
612-
});
625+
]
613626
}
614627

615628
const tar = new TarWriter();
@@ -900,6 +913,11 @@ ${options}}
900913
}
901914

902915
return {
916+
init: [
917+
{
918+
init: {},
919+
}
920+
],
903921
parse: [
904922
{
905923
parse: {},
@@ -930,6 +948,11 @@ export const echoResponsesWithExternalAuth = (
930948
providers: ExternalAuthProviderResource[],
931949
): EchoProvisionerResponses => {
932950
return {
951+
init: [
952+
{
953+
init: {},
954+
}
955+
],
933956
parse: [
934957
{
935958
parse: {},

0 commit comments

Comments
 (0)