import '@angular/compiler';
import { AnonymousCurrentAccountAdapter } from './anonymous-current-account.adapter';

describe('AnonymousCurrentAccountAdapter', () => {
  let adapter: AnonymousCurrentAccountAdapter;

  beforeEach(() => {
    adapter = new AnonymousCurrentAccountAdapter();
  });

  it('implements the CurrentAccountService port (is instantiable)', () => {
    expect(adapter).toBeDefined();
  });

  describe('displayName signal', () => {
    it('returns an empty string (anonymous identity)', () => {
      expect(adapter.displayName()).toBe('');
    });
  });

  describe('email signal', () => {
    it('returns an empty string (anonymous identity)', () => {
      expect(adapter.email()).toBe('');
    });
  });

  describe('load()', () => {
    it('is a no-op: calling it does not throw', () => {
      expect(() => adapter.load()).not.toThrow();
    });

    it('does not alter displayName after load()', () => {
      adapter.load();
      expect(adapter.displayName()).toBe('');
    });

    it('does not alter email after load()', () => {
      adapter.load();
      expect(adapter.email()).toBe('');
    });
  });
});
