Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,33 @@ describe('Resource initialization preferences', () => {
expect(determinations?.models.at(0)?.get('isCurrent')).toBe(true);
});

test('Cloning a loan does not carry over loan preparations', async () => {
const loan = new tables.Loan.Resource(
addMissingFields('Loan', {
loanPreparations: [
{
_tableName: 'LoanPreparation',
},
],
})
);

Comment thread
CarolineDenis marked this conversation as resolved.
await expect(
loan
.rgetCollection('loanPreparations')
.then((collection) => collection.models.length)
).resolves.toBe(1);

jest.spyOn(console, 'warn').mockImplementation();
const cloned = await loan.clone(true);

await expect(
cloned
.rgetCollection('loanPreparations')
.then((collection) => collection.models.length)
).resolves.toBe(0);
});

test('Cloning resource does not create duplicates', async () => {
// See Issue #3278

Expand Down
Loading