Skip to content

Commit

Permalink
test: add regression test for I18nString filter
Browse files Browse the repository at this point in the history
The AQL fragment created by this filter generates an internal error in ArangoDB 3.12.0 due to a regression.

The bug will be fixed with ArangoDB 3.12.1.
  • Loading branch information
Yogu committed Jun 14, 2024
1 parent 46b657e commit 553aaec
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"typescript.tsdk": "node_modules/typescript/lib"
}
1 change: 1 addition & 0 deletions spec/regression/logistics/model/country.graphqls
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ type Country
@roles(read: ["allusers"], readWrite: ["admin"]) {
isoCode: String @key
description: [Translation]
descriptionI18nString: I18nString
totalInvestment: String @roles(readWrite: "accounting")
someKey: String @flexSearch
}
12 changes: 12 additions & 0 deletions spec/regression/logistics/test-data.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
"translation": "Germany"
}
],
"descriptionI18nString": {
"de": "Deutschland",
"en": "Germany"
},
"totalInvestment": "EUR 50000000",
"someKey": "1"
},
Expand All @@ -31,6 +35,10 @@
"translation": "United Kingdom"
}
],
"descriptionI18nString": {
"de": "Vereinigtes Königreich",
"en": "United Kingdom"
},
"totalInvestment": "EUR 3000000",
"someKey": "2"
},
Expand All @@ -47,6 +55,10 @@
"translation": "United States"
}
],
"descriptionI18nString": {
"de": "Vereinigte Staaten",
"en": "United States"
},
"someKey": null
},
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
query filterI18nString {
allCountries(filter: { descriptionI18nString_some: { value: "Germany" } }) {
isoCode
}
}

query filterI18nStringWithCorrectLanguage {
allCountries(filter: { descriptionI18nString_some: { language: "en", value: "Germany" } }) {
isoCode
}
}

query filterI18nStringWithIncorrectLanguage {
allCountries(filter: { descriptionI18nString_some: { language: "de", value: "Germany" } }) {
isoCode
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"filterI18nString": {
"data": {
"allCountries": [
{
"isoCode": "DE"
}
]
}
},
"filterI18nStringWithCorrectLanguage": {
"data": {
"allCountries": [
{
"isoCode": "DE"
}
]
}
},
"filterI18nStringWithIncorrectLanguage": {
"data": {
"allCountries": []
}
}
}

0 comments on commit 553aaec

Please sign in to comment.