import { expect, suite, test } from "@cmmn/tools/test";
import { SyncStore } from "../store/sync.store.js";
import { ChannelMock } from "./mocks/channel.mock.js";
let StoreSpec = class StoreSpec {
    constructor() {
        this.mainStore = new SyncStore('main');
        this.testStore = new SyncStore('test');
        this.mainStore.adapter.connect(new ChannelMock());
        this.testStore.adapter.connect(new ChannelMock());
    }
    add() {
        this.mainStore.Items.set('one', {
            id: 'one',
            title: 'two'
        });
        expect(this.testStore.Items.get('one').title).toEqual('two');
    }
    delete() {
        this.add();
        this.mainStore.Items.delete('one');
        expect(this.testStore.Items.has('one')).toBe(false);
    }
    update() {
        this.add();
        this.mainStore.Items.set('one', {
            id: 'one',
            title: 'three'
        });
        expect(this.testStore.Items.get('one').title).toEqual('three');
    }
};
__decorate([
    test,
    __metadata("design:type", Function),
    __metadata("design:paramtypes", []),
    __metadata("design:returntype", void 0)
], StoreSpec.prototype, "add", null);
__decorate([
    test,
    __metadata("design:type", Function),
    __metadata("design:paramtypes", []),
    __metadata("design:returntype", void 0)
], StoreSpec.prototype, "delete", null);
__decorate([
    test,
    __metadata("design:type", Function),
    __metadata("design:paramtypes", []),
    __metadata("design:returntype", void 0)
], StoreSpec.prototype, "update", null);
StoreSpec = __decorate([
    suite,
    __metadata("design:paramtypes", [])
], StoreSpec);
export { StoreSpec };
class Entity {
}
//# sourceMappingURL=store.spec.js.map