From 0c9f62e3e259763531ed5c294b42b1c0322657fd Mon Sep 17 00:00:00 2001 From: Nico Gallinal Date: Mon, 13 May 2024 18:51:26 -0300 Subject: [PATCH 1/2] add test to make sure different names won't collapse to same alias --- test/alias-namespace.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/alias-namespace.js b/test/alias-namespace.js index f4d7f61f..b96af497 100644 --- a/test/alias-namespace.js +++ b/test/alias-namespace.js @@ -31,6 +31,12 @@ test(`it should generate an unminified column alias`, t => { t.is(ns.generate('column', 'firstname'), 'firstname') }) +test(`it should generate an unminified table alias (diffenent names won't collapse to alias)`, t => { + const ns = new AliasNamespace(false) + t.is(ns.generate('table', 'InformationItem'), 'Informatio') + t.is(ns.generate('table', 'InformationItemHasGroup'), 'Informatio$') +}) + if (process.env.DB === 'PG' && !process.env.STRATEGY && !process.env.MINIFY) { test('it should warn when alias in longer than dialect can accept', async t => { const spy = sinon.spy(console, 'warn') From d3933abc3693738af02c965879f1427d352247c9 Mon Sep 17 00:00:00 2001 From: Nico Gallinal Date: Mon, 13 May 2024 18:53:47 -0300 Subject: [PATCH 2/2] update changelg --- docs/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index e90e893d..ca5b386c 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -1,5 +1,6 @@ ### vNEXT #### Fixed +- [#530](https://github.com/join-monster/join-monster/pull/530): Add test to make sure different names won't collapse to same alias. - [#525](https://github.com/join-monster/join-monster/pull/525): Fix readthedocs deploys. - [#526](https://github.com/join-monster/join-monster/pull/526): Warns when alias length is exceeded for what postgres allows. - [#523](https://github.com/join-monster/join-monster/pull/523): Make demo runnable again.