Skip to content

Commit

Permalink
fix: Adapt Storybook trees to type parameter changes (#1044)
Browse files Browse the repository at this point in the history
  • Loading branch information
georgefst authored Aug 29, 2023
2 parents 2ed9656 + 5818c38 commit 624028a
Showing 1 changed file with 48 additions and 6 deletions.
54 changes: 48 additions & 6 deletions src/components/TreeReactFlow/TreeReactFlow.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,46 @@ const def6 = {
};
const typeDef1: TypeDef = {
name: { qualifiedModule: [], baseName: "Either-ish" },
params: ["a", "b"],
params: [
{
name: "a",
kind: {
body: { tag: "NoBody", contents: "KType" },
nodeId: "1110",
childTrees: [],
},
},
{
name: "b",
kind: {
body: { tag: "NoBody", contents: "KFun" },
nodeId: "1111",
childTrees: [
{
body: { tag: "NoBody", contents: "KType" },
nodeId: "1112",
childTrees: [],
},
{
body: { tag: "NoBody", contents: "KFun" },
nodeId: "1113",
childTrees: [
{
body: { tag: "NoBody", contents: "KHole" },
nodeId: "1114",
childTrees: [],
},
{
body: { tag: "NoBody", contents: "KType" },
nodeId: "1115",
childTrees: [],
},
],
},
],
},
},
],
constructors: [
{
name: { qualifiedModule: [], baseName: "Left" },
Expand Down Expand Up @@ -111,8 +150,8 @@ const typeDef1: TypeDef = {
body: {
tag: "TextBody",
contents: {
fst: "TCon",
snd: { baseName: "Pair" },
fst: "TVar",
snd: { baseName: "b" },
},
},
childTrees: [],
Expand All @@ -135,8 +174,8 @@ const typeDef1: TypeDef = {
body: {
tag: "TextBody",
contents: {
fst: "TVar",
snd: { baseName: "b" },
fst: "TCon",
snd: { baseName: "Pair" },
},
},
childTrees: [],
Expand Down Expand Up @@ -255,7 +294,10 @@ export const TreeType1: ComponentStory<typeof TreeReactFlow> = (
tag: "SelectionTypeDef",
contents: {
def: typeDef1.name,
node: { tag: "TypeDefParamNodeSelection", contents: "a" },
node: {
tag: "TypeDefParamNodeSelection",
contents: { param: "b", kindMeta: 1114 },
},
},
},
});
Expand Down

0 comments on commit 624028a

Please sign in to comment.