Skip to content

Commit

Permalink
Test cases to reproduce Patch Translation issue
Browse files Browse the repository at this point in the history
Change-type: patch
Signed-off-by: fisehara <[email protected]>
  • Loading branch information
fisehara authored and thgreasi committed Aug 30, 2024
1 parent 486b210 commit f72b73b
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions test/04-translations.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,36 @@ describe('04 native translation tests', function () {

expect(v1StudentCreated).to.deep.equal(vLatestStudent);
});

it('should patch a /v1 student filtered by its lastname', async () => {
const { body: v1StudentCreated } = await pineTest
.post({
apiPrefix: 'v1/',
resource: 'student',
body: {
matrix_number: faker.datatype.number({ min: 100000 }),
name: faker.name.firstName(),
lastname: faker.name.lastName(),
studies_at__campus: faculty.name,
},
})
.expect(201);

await pineTest
.patch({
apiPrefix: 'v1/',
resource: 'student',
options: {
$filter: {
lastname: v1StudentCreated.lastname,
},
},
body: {
lastname: v1StudentCreated.lastname + 'patched',
},
})
.expect(200);
});
});

describe('translate v2 model', () => {
Expand Down

0 comments on commit f72b73b

Please sign in to comment.