Skip to content

Commit

Permalink
Revert JSON test changes
Browse files Browse the repository at this point in the history
  • Loading branch information
DaddyWarbucks committed Jun 25, 2024
1 parent 579ffb5 commit b4cd384
Showing 1 changed file with 0 additions and 85 deletions.
85 changes: 0 additions & 85 deletions test/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,6 @@ const Model = sequelize.define('people', {
status: {
type: Sequelize.STRING,
defaultValue: 'pending'
},
profile: {
type: Sequelize.JSONB
}
}, {
freezeTableName: true,
Expand Down Expand Up @@ -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', () => {
Expand Down Expand Up @@ -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'
}
});
});
});
});

Expand Down

0 comments on commit b4cd384

Please sign in to comment.