From b4cd384c17c4aebba3718d9e5154a01731437a44 Mon Sep 17 00:00:00 2001 From: DaddyWarbucks Date: Tue, 25 Jun 2024 15:16:58 -0500 Subject: [PATCH] Revert JSON test changes --- test/index.test.ts | 85 ---------------------------------------------- 1 file changed, 85 deletions(-) diff --git a/test/index.test.ts b/test/index.test.ts index f10a97a..0fd7c80 100644 --- a/test/index.test.ts +++ b/test/index.test.ts @@ -109,9 +109,6 @@ const Model = sequelize.define('people', { status: { type: Sequelize.STRING, defaultValue: 'pending' - }, - profile: { - type: Sequelize.JSONB } }, { freezeTableName: true, @@ -999,47 +996,6 @@ describe('Feathers Sequelize Service', () => { }); expect(responseMulti).to.deep.equal([]); }); - - it('can query by JSON fields', async () => { - await app.service('people').create({ - name: 'Dave', - profile: { type: 'find' } - }); - - const found = await app.service('people').find({ - query: { - 'profile.type': 'find' - } - }) as any; - - assert.strictEqual(found.length, 1); - assert.deepStrictEqual(found[0].profile, { type: 'find' }); - }); - - it('Can update nested JSON fields', async () => { - const created = await app.service('people').create({ - name: 'Dave', - profile: { - location: { - city: 'Memphis', - state: 'Tennessee' - } - } - }); - - const patched = await app.service('people').patch(created.id, { - name: 'David', - 'profile.location.city': 'Nashville' - }) as any; - - assert.strictEqual(patched.name, 'David'); - assert.deepStrictEqual(patched.profile, { - location: { - city: 'Nashville', - state: 'Tennessee' - } - }); - }); }); describe('raw Service', () => { @@ -1183,47 +1139,6 @@ describe('Feathers Sequelize Service', () => { expect(results).to.be.an('array').with.lengthOf(1); expect(results[0]).to.be.an.instanceof(Model); }); - - it('can query by JSON fields', async () => { - await app.service('people').create({ - name: 'Dave', - profile: { type: 'find' } - }); - - const found = await app.service('people').find({ - query: { - 'profile.type': 'find' - } - }) as any; - - assert.strictEqual(found.length, 1); - assert.deepStrictEqual(found[0].profile, { type: 'find' }); - }); - - it('Can update nested JSON fields', async () => { - const created = await app.service('people').create({ - name: 'Dave', - profile: { - location: { - city: 'Memphis', - state: 'Tennessee' - } - } - }); - - const patched = await app.service('people').patch(created.id, { - name: 'David', - 'profile.location.city': 'Nashville' - }) as any; - - assert.strictEqual(patched.name, 'David'); - assert.deepStrictEqual(patched.profile, { - location: { - city: 'Nashville', - state: 'Tennessee' - } - }); - }); }); });