Skip to content
Draft
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
20 changes: 20 additions & 0 deletions packages/core/e2e/custom-field-relations.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ import {
RequestContext,
ShippingMethod,
TransactionalConnection,
Session,
AuthenticatedSession,
AnonymousSession
} from '@vendure/core';
import { createTestEnvironment } from '@vendure/testing';
import gql from 'graphql-tag';
Expand Down Expand Up @@ -57,6 +60,7 @@ const entitiesWithCustomFields: Array<keyof CustomFields> = [
'Promotion',
'Region',
'Seller',
'Session',
'ShippingMethod',
'TaxCategory',
'TaxRate',
Expand Down Expand Up @@ -1462,4 +1466,20 @@ describe('Custom field relations', () => {
]);
});
});

it('load relations on custom field session entity', async () => {
const connection = server.app.get(TransactionalConnection);
const sessions = await connection.rawConnection.getRepository(AnonymousSession).find({
relations: {
customFields: {
single: true,
},
},
take: 2,
});

// TODO: exploring behaviour how to load customFields from session, tested on Session directly and it is returning customFields, AnonymousSession and AuthenticatedSession ends in WHERE error. Necessary to check this deeper.
console.log('sessions:');
console.log(sessions);
});
});
Loading