beforeEach(done => { let container = new Container(); viewSlot = new ViewSlotMock(); viewFactory = new BoundViewFactoryMock(); observerLocator = new ObserverLocator(); repeatStrategyLocator = new RepeatStrategyLocator(); repeatStrategyMock = new RepeatStrategyMock(); strategy = new NumberRepeatStrategy(); container.registerInstance(TargetInstruction, instructionMock); container.registerInstance(ViewResources, viewResourcesMock); container.registerInstance(ViewSlot, viewSlot); container.registerInstance(BoundViewFactory, viewFactory); container.registerInstance(ObserverLocator, observerLocator); container.registerInstance(RepeatStrategyLocator, repeatStrategyLocator); component = StageComponent.withResources().inView('<div repeat.for="item of items"></div>').boundTo({ items: [] }) component.create(bootstrap).then(() => { repeat = component.viewModel; repeat.viewSlot = viewSlot; repeat.instruction = instructionMock; repeat.viewFactory = viewFactory; done(); }); });
beforeEach(() => { component = StageComponent .withResources('src/accordion') .inView('<accordion panels.two-way="panels"></accordion>') .boundTo({ panels: [{title: "Panel 1", viewUrl: "src/helperContent/viewOne.html"}, {title: "Panel 2", viewUrl: "src/helperContent/viewTwo.html"}] }); });
it('should keep original value instead of fallback to key, when defined via options', done => { const target = 'fallback-target'; const component = StageComponent .withResources('test/unit/mocks/rt-vm') .inView('<h5 id=' + target + ' t="hello">Hello!</h5>') .boundTo({ mydate: new Date() }); bootstrapTestEnvironment(component, { resources: { en: { translation: { hello: undefined } } }, skipTranslationOnMissingKey: true }); component.create(bootstrap) .then(() => { const elem = document.getElementById(target); expect(elem.innerHTML).toBe('Hello!'); component.dispose(); done(); }); });
beforeEach(() => { component = StageComponent .withResources('src/datatable') .inView('<datatable repository.bind="repository" columns="id, data as name"></datatable>') .boundTo(config); component.configure = aurelia => { aurelia.use.standardConfiguration() .feature('src'); }; });
beforeEach( ()=> { component = StageComponent .withResources('test/resources/dummy') .inView('') .boundTo({}); component.configure = function(aurelia) { aurelia.use .standardConfiguration(); }; });
beforeEach(() => { setConfig({ page : 1, pages : 10, limit : 30, pagerange: 3, resource : null, criteria : null, }); component = StageComponent .withResources('src/pager') .inView('<pager pages.bind="pages" page.bind="page" limit.bind="limit" pagerange.bind="pagerange" resource.bind="resource" criteria.bind="criteria"></pager>') .boundTo(config); });
beforeEach(() => { setConfig({ page: 1, pages: 10, limit: 30, pagerange: 3, resource: null, criteria: null }); component = StageComponent .withResources('src/pager') .inView('<pager pages.bind="pages" page.bind="page" limit.bind="limit" pagerange.bind="pagerange" resource.bind="resource" criteria.bind="criteria"></pager>') .boundTo(config); component.configure = aurelia => { aurelia.use.standardConfiguration(); aurelia.container.get(Config).configureNamespace('aurelia-pager', { location: './{{framework}}/{{view}}.html' }); }; });
beforeEach(() => { component = StageComponent.withResources('src/elements/ui-icon'); });
beforeEach(() => { component = StageComponent .withResources('rayen-ui/inputs/rui-check') .inView('<rui-check id="check1" checked.bind="itemChecked"></rui-check>') .boundTo({ itemChecked: true }); });
beforeEach(() => { component = StageComponent .withResources('rayen-ui/core/rui-row') .inView('<row></row>'); });
beforeEach(() => { component = StageComponent. withResources('src/modules/ui-modal'); });
beforeEach(() => { component = StageComponent. withResources('src/collections/ui-message'); });
beforeEach(() => { component = StageComponent. withResources('src/behaviors/ui-visibility'); });