Skip to content

Commit 872c6b9

Browse files
CitoIvanGoncharov
andauthored
UniqueArgumentDefinitionNamesRule: Improve tests (#3441)
Co-authored-by: Ivan Goncharov <[email protected]>
1 parent 533b423 commit 872c6b9

File tree

1 file changed

+56
-2
lines changed

1 file changed

+56
-2
lines changed

src/validation/__tests__/UniqueArgumentDefinitionNamesRule-test.ts

+56-2
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,14 @@ describe('Validate: Unique argument definition names', () => {
4141
someField(foo: String): String
4242
}
4343
44+
extend type SomeObject {
45+
anotherField(foo: String): String
46+
}
47+
48+
extend interface SomeInterface {
49+
anotherField(foo: String): String
50+
}
51+
4452
directive @someDirective(foo: String) on QUERY
4553
`);
4654
});
@@ -61,6 +69,20 @@ describe('Validate: Unique argument definition names', () => {
6169
): String
6270
}
6371
72+
extend type SomeObject {
73+
anotherField(
74+
foo: String
75+
bar: String
76+
): String
77+
}
78+
79+
extend interface SomeInterface {
80+
anotherField(
81+
foo: String
82+
bar: String
83+
): String
84+
}
85+
6486
directive @someDirective(
6587
foo: String
6688
bar: String
@@ -86,6 +108,22 @@ describe('Validate: Unique argument definition names', () => {
86108
): String
87109
}
88110
111+
extend type SomeObject {
112+
anotherField(
113+
foo: String
114+
bar: String
115+
bar: String
116+
): String
117+
}
118+
119+
extend interface SomeInterface {
120+
anotherField(
121+
bar: String
122+
foo: String
123+
foo: String
124+
): String
125+
}
126+
89127
directive @someDirective(
90128
foo: String
91129
bar: String
@@ -108,11 +146,27 @@ describe('Validate: Unique argument definition names', () => {
108146
{ line: 14, column: 11 },
109147
],
110148
},
149+
{
150+
message:
151+
'Argument "SomeObject.anotherField(bar:)" can only be defined once.',
152+
locations: [
153+
{ line: 21, column: 11 },
154+
{ line: 22, column: 11 },
155+
],
156+
},
157+
{
158+
message:
159+
'Argument "SomeInterface.anotherField(foo:)" can only be defined once.',
160+
locations: [
161+
{ line: 29, column: 11 },
162+
{ line: 30, column: 11 },
163+
],
164+
},
111165
{
112166
message: 'Argument "@someDirective(foo:)" can only be defined once.',
113167
locations: [
114-
{ line: 19, column: 9 },
115-
{ line: 21, column: 9 },
168+
{ line: 35, column: 9 },
169+
{ line: 37, column: 9 },
116170
],
117171
},
118172
]);

0 commit comments

Comments
 (0)