message: test dictionary branches
diff: @@ -78,10 +78,24 @@ test('can set messages', () => {
  });
  test('can set attributes', () => {
  - const dict = new Dictionary();
  + const dict = new Dictionary({
  + en: {
  + attributes: {},
  + messages: {}
  + }
  + });
  dict.setAttribute('en', 'email', 'Email Address');
  expect(dict.getAttribute('en', 'email')).toBe('Email Address');
  +
  + // test graceful population of non-existant directories.
  + dict.setAttribute('fr', 'email', 'address');
  + expect(dict.container.fr).toEqual({
  + messages: {},
  + attributes: {
  + email: 'address'
  + }
  + });
  });
  test('returns the default message for the given locale when no fallback is provided', () => {
  @@ -134,6 +148,7 @@ test('custom messages can be provided for specific fields', () => {
  });
  expect(dict.getFieldMessage('en', 'name', 'alpha')).toBe('custom message');
  + expect(dict.getFieldMessage('fr', 'name', 'alpha')).toBe(undefined);
  });
  test('able to get and set date format attributes', () => {
  @@ -143,4 +158,5 @@ test('able to get and set dateformat attributes', () => {
  expect(dict.getDateFormat('en')).toBe('MM/DD/YYYY');
  expect(dict.getDateFormat('ar')).toBe('DD/MM/YYYY');
  + expect(dict.getDateFormat('ru')).toBe(undefined);
  });
  