Commit Graph

19 Commits

Author SHA1 Message Date
Nicola Krumschmidt
d5d5692099 Remove unnecessary ampersand from URLs in filter tests (#13523) 2022-05-24 17:26:09 -04:00
ian
8f52fdf1f9 Validate type of items' primary keys (#13276)
* Validate type of items' primary keys

* Update tests

* Update validations

* Remove DB specific check for statusCode in existing e2e test

* Extract as util function

* Add unit test

* Refactor to generic validateKeys
2022-05-24 11:11:28 -04:00
Nicola Krumschmidt
79b7fc9d4c Fix applyFilter (#13497)
* Revert changes from #11737 to applyFilter

* Add case insensitive operators

* Improve ordering of operators

* Make filters test values more generic and improve structure
2022-05-24 09:37:13 -04:00
Bernat Vadell
7e1b946b20 Add support to insensitive case operators (#11737)
* feat: refactor apply-query & implements icontains

* feat: implements icontains in app

* New translations en-US.yaml

* tests: fix returns the filter operators for binary

* implement rest insensitive operators

* fix: proposal to fix #5996 (convert "in" into "exists")

* delete unused imports

* fix: prevent error when operator filter value is null

* fix: apply-query imports

* some tests

* fix: _nstarts_with not applied correctly

* tests: add some filter mathematical tests
2022-05-18 09:58:53 -04:00
Azri Kahar
ad46bfef51 Fix graphql schema for m2o fields without permissions to related collection (#13015)
* fix graphql schema for m2o fields

* add e2e tests for graphql m2o & o2m

* remove unused code

* fix mariadb json error

* attempt to fix oracle

* possibly fix graphql m2o queries
2022-05-03 12:51:12 -04:00
Josh Soref
0b01923b0d Spelling (#13072) 2022-05-02 13:16:03 -04:00
Rijk van Zanten
bd0668429f Deprecate use of faker (#12934)
* Deprecate use of faker

* Attempt to fix e2e

* uno mas

* eindelijk gerepareerd?
2022-04-21 16:29:03 -04:00
ian
68066eccb7 Remove UTC conversion from date, time and datetime fields (#10956)
* Remove UTC conversion from date, time and datetime fields

* Fix mysql / maria timestamps when not in UTC timezone

* Add sequential tests with node timezone change

* Increase connection attempt check

* Add error catching in tests flow setup

* Check for server connectivity

* Fix promises

* Fix timestamp inconsistencies

* Revert to previously used parseISO

* Ensure database and directus connection

* Add another timezone to test positive and negative GMT

* Set local server hostname to localhost

* Add tests for SQLite

* Use notNullable primary key

* Revert connection testing sleep duration

* Fix nested transactions on SQLite

* Increase MSSQL request timeout

* Add type override flag for SQLite

* Remove commented code

* Add type override flags for Oracle

* Updated test file path

* Increase test servers launch timeout

* Increase test servers launch timeout

* Update format of tests

* Fix typo

* Increase test timeout for CockroachDB

* Add type overrides when creating fields through collections service

* Remove time field type conversion for Oracle

* Update collections list in test

* Remove check for time field in Oracle

* Add missing continue...

* Remove database override

* Add note for SQLite

* Rename flags and extract shared util

* Abstract remaining DB specific checks

* Revert flags renaming except renaming of test files

* Use date helper to add field flag

* Move field date typecasting upstream

* Use timestamp helper for date-created and date-updated

* Fix tests

* Remove unused vars

* Add tests for date-created

* Increase connection attempt count

* Fix test for mariadb

* Increase allowable difference to account for delays

* Add tests for date-updated

* Fix tests again for mariadb

* Add date helpers post merge

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2022-04-06 16:15:22 -04:00
ian
7c91aa4278 Fix deep relational offset (#12076)
* Add relational offset

* Add offset tests

* Update relational test to use id

* Undo url change
2022-03-10 09:14:18 -05:00
Nitwel
8af5ddfceb Fix not being able to delete folder in data-model (#11432)
* fix not being able to delete folder in data-model

* add e2e tests

* fix e2e tests

* fix e2e tests
2022-02-04 13:13:42 -05:00
Rijk van Zanten
eee8725140 Resolve transaction unreliability issues in schema alterations (#11279)
* Start with test setup

* Reorder operations in transaction

Prevent dead roaches

* Fix test post payload

* Fix tests for real now?
2022-02-03 20:34:00 -05:00
Rijk van Zanten
4e68cd2df4 Upgrade E2E test setup (#11272) 2022-01-25 21:37:39 +00:00
Jay Cammarano
00a838f020 Docs for testing the API (#10275)
* mock-knex

* test on the migrations run started.

* test passing for run.up()

* reorganize /tests/ to allow integration tests

* e2e setup changes

* e2e jest.config moved

* e2e paths fixed, integration config

* add nonadmin role and user seed+migration

* auth/login w/ documentation (docs will be moved)

* update user seed

* add postgres10 to the ci?

* argon2 saves the day

* items tests passing with postgres10 support

* removed comments

* move generateHash out of directus_users

Co-authored-by: Jay Cammarano <jaycammarano@gmail.com>
2021-12-10 14:58:51 -05:00
Jay Cammarano
90bb9d4879 End-to-end tests for filters (#9078)
* reorganized for sanity

* filter tests for _eq/_neq

* logical operators

* update one one to many

* /:collection PATCH one to many

* base tables.id => uuids to minimize collisions

* tests pass

* added python to dockerfile

* tests passing

* ci?

* ci...

* hanging async
2021-11-01 14:21:44 -04:00
Jay Cammarano
3cb7f77cce End-to-end tests for a many to many relationship (#9021)
* get many m2o, create many m2o, expand seedTable()

* get many error handling

* added artists_events relation

* test for artists_events relations

* test for getOne m2m

* get many artists_events

* create one many-to-many

* updated createMany() for join tables

* create many artists_events

* tests for update one many to many

* removed stray "only"

* update many many to many

* improved update many

* tests for delete one artists_events

* delete many many to many tests

* update one + delete one with no relations

* removed only

* delete many artists with no relations
2021-10-25 20:41:31 -04:00
Jay Cammarano
43b0b9c62e E2E tests for the /items/:collection endpoint (#8549)
* added faker.js for testing

* edited env vars removed sqlite from testing (temp)

* getMany endpoint working with no data

* converted to faker

* getOne test passing

* schema for relations, item creation => factory

* many to many test working, factory refactored

* faker as dev dep

* new schema, tests passing postgres json exception

* tests passing

* upgrade tedious

* images

* removed images, rebuilt package-lock.json

* added users and schema map(WIP)

* user => artist m2o relation working on fields

* downgrade tedious

* user => guest, each => all

* items/:collection/invalid_id test

* items/invalid_collection/:id test added

* /:collection POST createOne test

* createMany factory, createMany endpoint test

* error handling tests

* create many with a many to one

* createMany with options to link relations

* some more describe sorting

* factory tests working

* tests passing
2021-10-20 23:20:50 +00:00
Jay Cammarano
5c16ed20b9 E2E Schema generated through migration and seed files (#8853)
* schema now represented in migrations (untested)

* seeds (untested)

* added seeding and fixed seed id #s

* removed run-migrations, not migrating .ts files

* setup.ts runs with migrate and seed

* removed unneeded console.log()

* guest id is uuid, because I can

* added guest_events, changed user => guest

* updated column types

* removing system_tables migration file

* fixed many to one relation for favorite_artist

* added relational tables to collections

* fixed relations

* geometry fields

* updated schema
2021-10-20 11:44:04 -04:00
Rijk van Zanten
405487ec43 e2e test improvement (#8469)
* Improve e2e test setup per file

* Improve e2e test setup
2021-09-30 15:19:41 -04:00
rijkvanzanten
88d66b41e1 Rename e2e-tests->tests 2021-04-16 16:53:28 -04:00