Skip to content

Commit

Permalink
Removed two unnecessary tests
Browse files Browse the repository at this point in the history
  • Loading branch information
leo committed Nov 14, 2024
1 parent 8aa7529 commit 2df0cfa
Showing 1 changed file with 0 additions and 86 deletions.
86 changes: 0 additions & 86 deletions tests/instructions/to.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -383,49 +383,6 @@ test('set single record to new json field with array', () => {
]);
});

test('set single record to new json field with empty array', () => {
const queries: Array<Query> = [
{
set: {
account: {
with: {
handle: 'elaine',
},
to: {
emails: [],
},
},
},
},
];

const models: Array<Model> = [
{
slug: 'account',
fields: [
{
slug: 'handle',
type: 'string',
},
{
slug: 'emails',
type: 'json',
},
],
},
];

const statements = compileQueries(queries, models);

expect(statements).toEqual([
{
statement: `UPDATE "accounts" SET "emails" = ?1, "ronin.updatedAt" = ?2 WHERE ("handle" = ?3) RETURNING *`,
params: ['[]', expect.stringMatching(RECORD_TIMESTAMP_REGEX), 'elaine'],
returning: true,
},
]);
});

test('set single record to new json field with object', () => {
const queries: Array<Query> = [
{
Expand Down Expand Up @@ -476,49 +433,6 @@ test('set single record to new json field with object', () => {
]);
});

test('set single record to new json field with empty object', () => {
const queries: Array<Query> = [
{
set: {
account: {
with: {
handle: 'elaine',
},
to: {
emails: {},
},
},
},
},
];

const models: Array<Model> = [
{
slug: 'account',
fields: [
{
slug: 'handle',
type: 'string',
},
{
slug: 'emails',
type: 'json',
},
],
},
];

const statements = compileQueries(queries, models);

expect(statements).toEqual([
{
statement: `UPDATE "accounts" SET "emails" = ?1, "ronin.updatedAt" = ?2 WHERE ("handle" = ?3) RETURNING *`,
params: ['{}', expect.stringMatching(RECORD_TIMESTAMP_REGEX), 'elaine'],
returning: true,
},
]);
});

test('set single record to new grouped string field', () => {
const queries: Array<Query> = [
{
Expand Down

0 comments on commit 2df0cfa

Please sign in to comment.