Skip to content

Commit fb57bae

Browse files
committed
refactor: clean up code
1 parent 2500ff1 commit fb57bae

File tree

6 files changed

+147
-129
lines changed

6 files changed

+147
-129
lines changed

e2e-tests/contentful/src/components/references/content-reference.js

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,7 @@
11
import React from "react"
22

3-
export const ContentfulContentReference = ({
4-
one,
5-
many,
6-
content_reference,
7-
title,
8-
}) => {
9-
const references = [
10-
one,
11-
...(many || []),
12-
...(content_reference || []),
13-
].filter(Boolean)
3+
export const ContentfulContentReference = ({ one, many, title }) => {
4+
const references = [one, ...(many || [])].filter(Boolean)
145
return (
156
<p data-cy-id="reference">
167
[ContentfulReference] {title}: [

e2e-tests/contentful/src/pages/content-reference.js

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,40 +53,45 @@ export const pageQuery = graphql`
5353
contentful_id
5454
one {
5555
__typename
56+
contentful_id
5657
... on ContentfulText {
57-
contentful_id
5858
title
5959
short
6060
}
6161
... on ContentfulContentReference {
62-
contentful_id
6362
title
64-
content_reference {
63+
one {
64+
... on ContentfulContentReference {
65+
title
66+
}
67+
}
68+
many {
6569
... on ContentfulContentReference {
66-
contentful_id
6770
title
6871
}
6972
}
7073
}
7174
}
7275
many {
7376
__typename
77+
contentful_id
7478
... on ContentfulText {
75-
contentful_id
7679
title
7780
short
7881
}
7982
... on ContentfulNumber {
80-
contentful_id
8183
title
8284
integer
8385
}
8486
... on ContentfulContentReference {
85-
contentful_id
8687
title
87-
content_reference {
88+
one {
89+
... on ContentfulContentReference {
90+
title
91+
}
92+
}
93+
many {
8894
... on ContentfulContentReference {
89-
id
9095
title
9196
}
9297
}

e2e-tests/contentful/src/pages/rich-text.js

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -118,34 +118,46 @@ export const pageQuery = graphql`
118118
contentful_id
119119
title
120120
one {
121+
__typename
122+
contentful_id
123+
... on ContentfulText {
124+
title
125+
short
126+
}
121127
... on ContentfulContentReference {
122-
contentful_id
123128
title
124-
content_reference {
129+
one {
130+
... on ContentfulContentReference {
131+
title
132+
}
133+
}
134+
many {
125135
... on ContentfulContentReference {
126-
contentful_id
127136
title
128137
}
129138
}
130139
}
131140
}
132141
many {
142+
__typename
143+
contentful_id
133144
... on ContentfulText {
134-
contentful_id
135145
title
136146
short
137147
}
138148
... on ContentfulNumber {
139-
contentful_id
140149
title
141150
integer
142151
}
143152
... on ContentfulContentReference {
144-
contentful_id
145153
title
146-
content_reference {
154+
one {
155+
... on ContentfulContentReference {
156+
title
157+
}
158+
}
159+
many {
147160
... on ContentfulContentReference {
148-
id
149161
title
150162
}
151163
}

0 commit comments

Comments
 (0)