Skip to content

test: verify that unicode in names of non-cruddl collections does not… #309

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
- run:
docker run --name arangodb -p 127.0.0.1:8529:8529 -d -e ARANGO_NO_AUTH=1 ${{
matrix.arango-image }}
docker run --name arangodb -p 127.0.0.1:8529:8529 -d -e ARANGO_NO_AUTH=1
--database.extended-names-databases=true ${{ matrix.arango-image }}
- run: timeout 10 docker logs --follow arangodb || true # wait until arangodb is started
- run: curl -L http://localhost:8529/_api/version
- run: npm ci
Expand Down
32 changes: 32 additions & 0 deletions spec/database/arangodb/arangodb-adapter.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,5 +151,37 @@ describe('ArangoDBAdapter', () => {
},
]);
});

it('it does not care about other collections using unicode names', async function () {
// can't use arrow function because we need the "this"
if (isArangoDBDisabled()) {
(this as any).skip();
return;
}

const model = createSimpleModel(gql`
type Delivery @rootEntity {
deliveryNumber: String
}
`);

const dbConfig = await createTempDatabase();
const adapter = new ArangoDBAdapter({
...dbConfig,
createIndicesInBackground: true,
});
const db = getTempDatabase();
await db.collection('unübertroffen-gute-collection\uD83D\uDCA5').create({});

await adapter.updateSchema(model);

const collections = (await db.listCollections()).map((c) => c.name);

expect(collections).to.deep.equalInAnyOrder([
'billingEntities',
'deliveries',
'unübertroffen-gute-collection\uD83D\uDCA5',
]);
});
});
});