blob: 1bd9cf934e13167f10b360866ae5b9543ecae1ba [file] [log] [blame]
/*
******************************************************************************
* Copyright © 2018 PTA GmbH.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
*
* http://www.eclipse.org/legal/epl-v10.html
*
******************************************************************************
*/
import { TestBed } from '@angular/core/testing';
import { EmailDistributionListAgGridConfiguration } from './email-distribution-ag-grid-configuration';
import { SessionContext } from '../../common/session-context';
describe('EmailDistributionListAgGridConfiguration', () => {
beforeEach(() => {
TestBed.configureTestingModule({
});
});
it('should provide the correct functions', (() => {
const configArray: any = EmailDistributionListAgGridConfiguration.createColumnDefs();
const idSegment = configArray[0];
expect(idSegment.field).toBe('id');
const emailAddressSegment = configArray[1];
expect(emailAddressSegment.field).toBe('emailAddress');
}));
it('should provide the correct modeCellRenderer', (() => {
const configArray: any = (EmailDistributionListAgGridConfiguration as any).modeCellRenderer(
{
context:
{
componentParent:
{
sessionContext: {
isLocked: function (data: any) { return true; }
},
modeValidator:
{
isEditModeAllowed: function (data: any) { return true; },
isEmailEditModeAllowed: function (data: any) { return true; }
},
deleteEmailAddress: function (data: any) { return true; }
}
},
params: {},
data: { id: 1, emailAddress: 'test@test.de', delete: false }
}
);
}));
});