"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
Object.defineProperty(exports, "__esModule", { value: true });
const ts_mockito_1 = require("ts-mockito");
const models_1 = require("../../models");
const services_1 = require("../../services");
const me_1 = require("./me");
let mockConnectionService = ts_mockito_1.mock(services_1.ConnectionService);
beforeEach(() => {
    ts_mockito_1.reset(mockConnectionService);
});
describe('me', () => {
    it('calls the connection service', () => __awaiter(void 0, void 0, void 0, function* () {
        ts_mockito_1.when(mockConnectionService.send(ts_mockito_1.anything(), ts_mockito_1.anything())).thenResolve(['result', 'no']);
        const result = yield me_1.getMe(ts_mockito_1.instance(mockConnectionService));
        ts_mockito_1.verify(mockConnectionService.send(ts_mockito_1.deepEqual({}), ts_mockito_1.deepEqual(models_1.apiConfig.me)));
        expect(result).toBe('result');
    }));
});
