[#872] changed the schema required validator to be optional for auth collections

This commit is contained in:
Gani Georgiev
2022-11-16 15:13:04 +02:00
parent 4528f075dc
commit 6e9cf986c5
45 changed files with 1166 additions and 445 deletions

View File

@@ -87,6 +87,25 @@ func TestCollectionsImportSubmit(t *testing.T) {
"OnModelBeforeCreate": 2,
},
},
{
name: "test empty base collection schema",
jsonData: `{
"collections": [
{
"name": "import1"
},
{
"name": "import2",
"type": "auth"
}
]
}`,
expectError: true,
expectCollectionsCount: 7,
expectEvents: map[string]int{
"OnModelBeforeCreate": 2,
},
},
{
name: "all imported collections has valid data",
jsonData: `{
@@ -110,14 +129,18 @@ func TestCollectionsImportSubmit(t *testing.T) {
"type":"bool"
}
]
},
{
"name": "import3",
"type": "auth"
}
]
}`,
expectError: false,
expectCollectionsCount: 9,
expectCollectionsCount: 10,
expectEvents: map[string]int{
"OnModelBeforeCreate": 2,
"OnModelAfterCreate": 2,
"OnModelBeforeCreate": 3,
"OnModelAfterCreate": 3,
},
},
{