Skip to content

Commit 4d6e37d

Browse files
committed
Fixed Test Snapshots
1 parent 24cf5c5 commit 4d6e37d

13 files changed

+321
-12
lines changed

src/HotChocolate/AspNetCore/test/AspNetCore.Authorization.Tests/AuthorizationPolicyProviderTess.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,12 @@ public async Task Policies_Are_Not_Cached_If_PolicyProvider_Disallows_Caching()
8080
Assert.Null(result1.Errors);
8181
Assert.Equal(HttpStatusCode.OK, result2.StatusCode);
8282
Assert.Null(result2.Errors);
83+
84+
#if NET6_0
85+
Assert.Equal(1, policyProvider.InvocationsOfGetPolicyAsync);
86+
#else
8387
Assert.Equal(2, policyProvider.InvocationsOfGetPolicyAsync);
88+
#endif
8489
}
8590

8691
public class Query

src/HotChocolate/AspNetCore/test/AspNetCore.Tests/__snapshots__/HttpGetSchemaMiddlewareTests.Download_GraphQL_SDL_NET6.snap

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,8 @@ enum Unit {
122122
"The `@defer` directive may be provided for fragment spreads and inline fragments to inform the executor to delay the execution of the current fragment to indicate deprioritization of the current fragment. A query with `@defer` directive will cause the request to potentially return multiple responses, where non-deferred data is delivered in the initial response and data deferred is delivered in a subsequent response. `@include` and `@skip` take precedence over `@defer`."
123123
directive @defer("If this argument label has a value other than null, it will be passed on to the result of this defer directive. This label is intended to give client applications a way to identify to which fragment a deferred result belongs to." label: String "Deferred when true." if: Boolean) on FRAGMENT_SPREAD | INLINE_FRAGMENT
124124

125+
directive @foo(bar: Int!) on SUBSCRIPTION
126+
125127
"The `@stream` directive may be provided for a field of `List` type so that the backend can leverage technology such as asynchronous iterators to provide a partial list in the initial response, and additional list items in subsequent responses. `@include` and `@skip` take precedence over `@stream`."
126128
directive @stream("If this argument label has a value other than null, it will be passed on to the result of this stream directive. This label is intended to give client applications a way to identify to which fragment a streamed result belongs to." label: String "The initial elements that shall be send down to the consumer." initialCount: Int! = 0 "Streamed when true." if: Boolean) on FIELD
127129

src/HotChocolate/AspNetCore/test/AspNetCore.Tests/__snapshots__/HttpGetSchemaMiddlewareTests.Download_GraphQL_Schema_NET6.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
```text
44
Headers:
5-
ETag: "1-kBEjhe2t+jfqbeZRxnezu0WDQFYAc0qzjLF1RlHs428="
5+
ETag: "1-kqrhyLMoq/15r5KsM6OidIHC9SxZ/RTdPKy5i3Bw42Y="
66
Cache-Control: public, must-revalidate, max-age=3600
77
Content-Type: application/graphql; charset=utf-8
88
Content-Disposition: attachment; filename="schema.graphql"
99
Last-Modified: Fri, 01 Jan 2021 00:00:00 GMT
10-
Content-Length: 5070
10+
Content-Length: 5113
1111
-------------------------->
1212
Status Code: OK
1313
-------------------------->
@@ -135,6 +135,8 @@ enum Unit {
135135
"The `@defer` directive may be provided for fragment spreads and inline fragments to inform the executor to delay the execution of the current fragment to indicate deprioritization of the current fragment. A query with `@defer` directive will cause the request to potentially return multiple responses, where non-deferred data is delivered in the initial response and data deferred is delivered in a subsequent response. `@include` and `@skip` take precedence over `@defer`."
136136
directive @defer("If this argument label has a value other than null, it will be passed on to the result of this defer directive. This label is intended to give client applications a way to identify to which fragment a deferred result belongs to." label: String "Deferred when true." if: Boolean) on FRAGMENT_SPREAD | INLINE_FRAGMENT
137137
138+
directive @foo(bar: Int!) on SUBSCRIPTION
139+
138140
"The `@stream` directive may be provided for a field of `List` type so that the backend can leverage technology such as asynchronous iterators to provide a partial list in the initial response, and additional list items in subsequent responses. `@include` and `@skip` take precedence over `@stream`."
139141
directive @stream("If this argument label has a value other than null, it will be passed on to the result of this stream directive. This label is intended to give client applications a way to identify to which fragment a streamed result belongs to." label: String "The initial elements that shall be send down to the consumer." initialCount: Int! = 0 "Streamed when true." if: Boolean) on FIELD
140142

src/HotChocolate/AspNetCore/test/AspNetCore.Tests/__snapshots__/HttpGetSchemaMiddlewareTests.Download_GraphQL_Schema_Slicing_Args_Enabled_NET6.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
```text
44
Headers:
5-
ETag: "1-kBEjhe2t+jfqbeZRxnezu0WDQFYAc0qzjLF1RlHs428="
5+
ETag: "1-kqrhyLMoq/15r5KsM6OidIHC9SxZ/RTdPKy5i3Bw42Y="
66
Cache-Control: public, must-revalidate, max-age=3600
77
Content-Type: application/graphql; charset=utf-8
88
Content-Disposition: attachment; filename="schema.graphql"
99
Last-Modified: Fri, 01 Jan 2021 00:00:00 GMT
10-
Content-Length: 5070
10+
Content-Length: 5113
1111
-------------------------->
1212
Status Code: OK
1313
-------------------------->
@@ -135,6 +135,8 @@ enum Unit {
135135
"The `@defer` directive may be provided for fragment spreads and inline fragments to inform the executor to delay the execution of the current fragment to indicate deprioritization of the current fragment. A query with `@defer` directive will cause the request to potentially return multiple responses, where non-deferred data is delivered in the initial response and data deferred is delivered in a subsequent response. `@include` and `@skip` take precedence over `@defer`."
136136
directive @defer("If this argument label has a value other than null, it will be passed on to the result of this defer directive. This label is intended to give client applications a way to identify to which fragment a deferred result belongs to." label: String "Deferred when true." if: Boolean) on FRAGMENT_SPREAD | INLINE_FRAGMENT
137137
138+
directive @foo(bar: Int!) on SUBSCRIPTION
139+
138140
"The `@stream` directive may be provided for a field of `List` type so that the backend can leverage technology such as asynchronous iterators to provide a partial list in the initial response, and additional list items in subsequent responses. `@include` and `@skip` take precedence over `@stream`."
139141
directive @stream("If this argument label has a value other than null, it will be passed on to the result of this stream directive. This label is intended to give client applications a way to identify to which fragment a streamed result belongs to." label: String "The initial elements that shall be send down to the consumer." initialCount: Int! = 0 "Streamed when true." if: Boolean) on FIELD
140142

src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_Fetch_First_2_Items_Between.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
}
2222
},
2323
"extensions": {
24-
"sql": "-- @__p_0='1'\n-- @__p_1='4'\n-- @__p_2='3'\nSELECT b.\"Id\", b.\"AlwaysNull\", b.\"DisplayName\", b.\"Name\", b.\"BrandDetails_Country_Name\"\nFROM \"Brands\" AS b\nWHERE b.\"Id\" > @__p_0 AND b.\"Id\" < @__p_1\nORDER BY b.\"Id\"\nLIMIT @__p_2"
24+
"sql": "-- @__p_0='1'\n-- @__p_1='4'\n-- @__p_2='3'\nSELECT b.\"Id\", b.\"AlwaysNull\", b.\"DisplayName\", b.\"Name\", b.\"BrandDetails_Country_Name\"\nFROM \"Brands\" AS b\nWHERE (b.\"Id\" > @__p_0) AND (b.\"Id\" < @__p_1)\nORDER BY b.\"Id\"\nLIMIT @__p_2"
2525
}
2626
}
2727
```

src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_Fetch_Last_2_Items_Between.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
}
2222
},
2323
"extensions": {
24-
"sql": "-- @__p_0='97'\n-- @__p_1='100'\n-- @__p_2='3'\nSELECT b.\"Id\", b.\"AlwaysNull\", b.\"DisplayName\", b.\"Name\", b.\"BrandDetails_Country_Name\"\nFROM \"Brands\" AS b\nWHERE b.\"Id\" > @__p_0 AND b.\"Id\" < @__p_1\nORDER BY b.\"Id\" DESC\nLIMIT @__p_2"
24+
"sql": "-- @__p_0='97'\n-- @__p_1='100'\n-- @__p_2='3'\nSELECT b.\"Id\", b.\"AlwaysNull\", b.\"DisplayName\", b.\"Name\", b.\"BrandDetails_Country_Name\"\nFROM \"Brands\" AS b\nWHERE (b.\"Id\" > @__p_0) AND (b.\"Id\" < @__p_1)\nORDER BY b.\"Id\" DESC\nLIMIT @__p_2"
2525
}
2626
}
2727
```
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,153 @@
11
# BatchPaging_Last_5
22

3+
## 1
4+
5+
```json
6+
{
7+
"First": "MTAw",
8+
"Last": "OTk=",
9+
"Items": [
10+
{
11+
"Id": 100,
12+
"Name": "Product 0-99",
13+
"Description": null,
14+
"Price": 0.0,
15+
"ImageFileName": null,
16+
"TypeId": 1,
17+
"Type": null,
18+
"BrandId": 1,
19+
"Brand": null,
20+
"AvailableStock": 0,
21+
"RestockThreshold": 0,
22+
"MaxStockThreshold": 0,
23+
"OnReorder": false
24+
},
25+
{
26+
"Id": 99,
27+
"Name": "Product 0-98",
28+
"Description": null,
29+
"Price": 0.0,
30+
"ImageFileName": null,
31+
"TypeId": 1,
32+
"Type": null,
33+
"BrandId": 1,
34+
"Brand": null,
35+
"AvailableStock": 0,
36+
"RestockThreshold": 0,
37+
"MaxStockThreshold": 0,
38+
"OnReorder": false
39+
}
40+
]
41+
}
42+
```
43+
44+
## 2
45+
46+
```json
47+
{
48+
"First": "MjAw",
49+
"Last": "MTk5",
50+
"Items": [
51+
{
52+
"Id": 200,
53+
"Name": "Product 1-99",
54+
"Description": null,
55+
"Price": 0.0,
56+
"ImageFileName": null,
57+
"TypeId": 1,
58+
"Type": null,
59+
"BrandId": 2,
60+
"Brand": null,
61+
"AvailableStock": 0,
62+
"RestockThreshold": 0,
63+
"MaxStockThreshold": 0,
64+
"OnReorder": false
65+
},
66+
{
67+
"Id": 199,
68+
"Name": "Product 1-98",
69+
"Description": null,
70+
"Price": 0.0,
71+
"ImageFileName": null,
72+
"TypeId": 1,
73+
"Type": null,
74+
"BrandId": 2,
75+
"Brand": null,
76+
"AvailableStock": 0,
77+
"RestockThreshold": 0,
78+
"MaxStockThreshold": 0,
79+
"OnReorder": false
80+
}
81+
]
82+
}
83+
```
84+
85+
## 3
86+
387
```json
4-
{}
88+
{
89+
"First": "MzAw",
90+
"Last": "Mjk5",
91+
"Items": [
92+
{
93+
"Id": 300,
94+
"Name": "Product 2-99",
95+
"Description": null,
96+
"Price": 0.0,
97+
"ImageFileName": null,
98+
"TypeId": 1,
99+
"Type": null,
100+
"BrandId": 3,
101+
"Brand": null,
102+
"AvailableStock": 0,
103+
"RestockThreshold": 0,
104+
"MaxStockThreshold": 0,
105+
"OnReorder": false
106+
},
107+
{
108+
"Id": 299,
109+
"Name": "Product 2-98",
110+
"Description": null,
111+
"Price": 0.0,
112+
"ImageFileName": null,
113+
"TypeId": 1,
114+
"Type": null,
115+
"BrandId": 3,
116+
"Brand": null,
117+
"AvailableStock": 0,
118+
"RestockThreshold": 0,
119+
"MaxStockThreshold": 0,
120+
"OnReorder": false
121+
}
122+
]
123+
}
124+
```
125+
126+
## SQL 0
127+
128+
```sql
129+
SELECT t."BrandId", t0."Id", t0."AvailableStock", t0."BrandId", t0."Description", t0."ImageFileName", t0."MaxStockThreshold", t0."Name", t0."OnReorder", t0."Price", t0."RestockThreshold", t0."TypeId"
130+
FROM (
131+
SELECT p."BrandId"
132+
FROM "Products" AS p
133+
WHERE p."BrandId" IN (1, 2, 3)
134+
GROUP BY p."BrandId"
135+
) AS t
136+
LEFT JOIN (
137+
SELECT t1."Id", t1."AvailableStock", t1."BrandId", t1."Description", t1."ImageFileName", t1."MaxStockThreshold", t1."Name", t1."OnReorder", t1."Price", t1."RestockThreshold", t1."TypeId"
138+
FROM (
139+
SELECT p0."Id", p0."AvailableStock", p0."BrandId", p0."Description", p0."ImageFileName", p0."MaxStockThreshold", p0."Name", p0."OnReorder", p0."Price", p0."RestockThreshold", p0."TypeId", ROW_NUMBER() OVER(PARTITION BY p0."BrandId" ORDER BY p0."Id" DESC) AS row
140+
FROM "Products" AS p0
141+
WHERE p0."BrandId" = 1 OR p0."BrandId" = 2 OR p0."BrandId" = 3
142+
) AS t1
143+
WHERE t1.row <= 3
144+
) AS t0 ON t."BrandId" = t0."BrandId"
145+
ORDER BY t."BrandId", t0."BrandId", t0."Id" DESC
5146
```
147+
148+
## Expression 0
149+
150+
```text
151+
[Microsoft.EntityFrameworkCore.Query.EntityQueryRootExpression].Where(t => (((t.BrandId == 1) OrElse (t.BrandId == 2)) OrElse (t.BrandId == 3))).GroupBy(k => k.BrandId).Select(g => new Group`2() {Key = g.Key, Items = g.OrderByDescending(p => p.Id).Take(3).ToList()})
152+
```
153+
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,153 @@
11
# BatchPaging_Last_5
22

3+
## 1
4+
5+
```json
6+
{
7+
"First": "MTAw",
8+
"Last": "OTk=",
9+
"Items": [
10+
{
11+
"Id": 100,
12+
"Name": "Product 0-99",
13+
"Description": null,
14+
"Price": 0.0,
15+
"ImageFileName": null,
16+
"TypeId": 1,
17+
"Type": null,
18+
"BrandId": 1,
19+
"Brand": null,
20+
"AvailableStock": 0,
21+
"RestockThreshold": 0,
22+
"MaxStockThreshold": 0,
23+
"OnReorder": false
24+
},
25+
{
26+
"Id": 99,
27+
"Name": "Product 0-98",
28+
"Description": null,
29+
"Price": 0.0,
30+
"ImageFileName": null,
31+
"TypeId": 1,
32+
"Type": null,
33+
"BrandId": 1,
34+
"Brand": null,
35+
"AvailableStock": 0,
36+
"RestockThreshold": 0,
37+
"MaxStockThreshold": 0,
38+
"OnReorder": false
39+
}
40+
]
41+
}
42+
```
43+
44+
## 2
45+
46+
```json
47+
{
48+
"First": "MjAw",
49+
"Last": "MTk5",
50+
"Items": [
51+
{
52+
"Id": 200,
53+
"Name": "Product 1-99",
54+
"Description": null,
55+
"Price": 0.0,
56+
"ImageFileName": null,
57+
"TypeId": 1,
58+
"Type": null,
59+
"BrandId": 2,
60+
"Brand": null,
61+
"AvailableStock": 0,
62+
"RestockThreshold": 0,
63+
"MaxStockThreshold": 0,
64+
"OnReorder": false
65+
},
66+
{
67+
"Id": 199,
68+
"Name": "Product 1-98",
69+
"Description": null,
70+
"Price": 0.0,
71+
"ImageFileName": null,
72+
"TypeId": 1,
73+
"Type": null,
74+
"BrandId": 2,
75+
"Brand": null,
76+
"AvailableStock": 0,
77+
"RestockThreshold": 0,
78+
"MaxStockThreshold": 0,
79+
"OnReorder": false
80+
}
81+
]
82+
}
83+
```
84+
85+
## 3
86+
387
```json
4-
{}
88+
{
89+
"First": "MzAw",
90+
"Last": "Mjk5",
91+
"Items": [
92+
{
93+
"Id": 300,
94+
"Name": "Product 2-99",
95+
"Description": null,
96+
"Price": 0.0,
97+
"ImageFileName": null,
98+
"TypeId": 1,
99+
"Type": null,
100+
"BrandId": 3,
101+
"Brand": null,
102+
"AvailableStock": 0,
103+
"RestockThreshold": 0,
104+
"MaxStockThreshold": 0,
105+
"OnReorder": false
106+
},
107+
{
108+
"Id": 299,
109+
"Name": "Product 2-98",
110+
"Description": null,
111+
"Price": 0.0,
112+
"ImageFileName": null,
113+
"TypeId": 1,
114+
"Type": null,
115+
"BrandId": 3,
116+
"Brand": null,
117+
"AvailableStock": 0,
118+
"RestockThreshold": 0,
119+
"MaxStockThreshold": 0,
120+
"OnReorder": false
121+
}
122+
]
123+
}
124+
```
125+
126+
## SQL 0
127+
128+
```sql
129+
SELECT t."BrandId", t0."Id", t0."AvailableStock", t0."BrandId", t0."Description", t0."ImageFileName", t0."MaxStockThreshold", t0."Name", t0."OnReorder", t0."Price", t0."RestockThreshold", t0."TypeId"
130+
FROM (
131+
SELECT p."BrandId"
132+
FROM "Products" AS p
133+
WHERE p."BrandId" IN (1, 2, 3)
134+
GROUP BY p."BrandId"
135+
) AS t
136+
LEFT JOIN (
137+
SELECT t1."Id", t1."AvailableStock", t1."BrandId", t1."Description", t1."ImageFileName", t1."MaxStockThreshold", t1."Name", t1."OnReorder", t1."Price", t1."RestockThreshold", t1."TypeId"
138+
FROM (
139+
SELECT p0."Id", p0."AvailableStock", p0."BrandId", p0."Description", p0."ImageFileName", p0."MaxStockThreshold", p0."Name", p0."OnReorder", p0."Price", p0."RestockThreshold", p0."TypeId", ROW_NUMBER() OVER(PARTITION BY p0."BrandId" ORDER BY p0."Id" DESC) AS row
140+
FROM "Products" AS p0
141+
WHERE p0."BrandId" = 1 OR p0."BrandId" = 2 OR p0."BrandId" = 3
142+
) AS t1
143+
WHERE t1.row <= 3
144+
) AS t0 ON t."BrandId" = t0."BrandId"
145+
ORDER BY t."BrandId", t0."BrandId", t0."Id" DESC
5146
```
147+
148+
## Expression 0
149+
150+
```text
151+
[Microsoft.EntityFrameworkCore.Query.EntityQueryRootExpression].Where(t => (((t.BrandId == 1) OrElse (t.BrandId == 2)) OrElse (t.BrandId == 3))).GroupBy(k => k.BrandId).Select(g => new Group`2() {Key = g.Key, Items = g.OrderByDescending(p => p.Id).Take(3).ToList()})
152+
```
153+

0 commit comments

Comments
 (0)