import { microloansKeys } from './queries';

describe('microloansKeys.contractPreview', () => {
  it('includes the optional bank fields in the cache key', () => {
    expect(
      microloansKeys.contractPreview(
        'offer-1',
        100_000,
        12,
        '002010077777777771',
        'BANAMEX',
      ),
    ).toEqual([
      'microloans',
      'contract-preview',
      'offer-1',
      100_000,
      12,
      '002010077777777771',
      'BANAMEX',
    ]);
  });

  it('defaults the bank fields to empty strings', () => {
    expect(microloansKeys.contractPreview('offer-1', 100_000, 12)).toEqual([
      'microloans',
      'contract-preview',
      'offer-1',
      100_000,
      12,
      '',
      '',
    ]);
  });
});
