Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('should use route as primary property', done => {
component = StageComponent
.withResources(PLATFORM.moduleName('src/route-href'))
.inView('<a></a>')
.boundTo({ name: 'b' });
configure(component);
component.create(bootstrap)
.then(() => {
expect(component.viewModel.route).toBe('b');
done();
});
});
});
const bootstrapCompose = async (view?: string, viewModel?: T) => {
const component: ComponentTester = StageComponent
.withResources()
.inView(view || '')
.boundTo(viewModel || {});
await component.create(bootstrap);
return {
component,
compose: component.viewModel,
viewModel
};
};
});
async function bootstrapComponent($viewModel?: ITestAppInterface) {
component = StageComponent
.withResources([
...resources,
...extraResources
])
.inView($view)
.boundTo($viewModel);
await component.create(bootstrap);
expect(document.body.contains(component.element)).toBe(true, 'repeat is setup in document');
return { virtualRepeat: component.viewModel, viewModel: $viewModel, component: component };
}
}
async function bootstrapComponent($viewModel?: ITestAppInterface, extraResources?: any[], $view = view) {
component = StageComponent
.withResources([
...resources,
...extraResources
])
.inView($view)
.boundTo($viewModel);
await component.create(bootstrap);
expect(document.body.contains(component.element)).toBe(true, 'repeat is setup in document');
return { virtualRepeat: component.viewModel, viewModel: $viewModel, component: component };
}
beforeEach(() => {
component = StageComponent
.withResources('dist/test/src/google-maps')
.inView('');
});
beforeAll(async () => {
component = StageComponent.withResources()
.inView(``)
.boundTo({});
component.bootstrap(aurelia => {
return auconfig(aurelia, (config: UIFrameworkConfig) => {
config
.setApiBaseUrl(AppBaseUrl)
.setApiHeaders(AppHeaders)
.setKeyValue("title", "Test Title");
});
});
await component.create(bootstrap);
});
beforeEach(() => {
component = StageComponent.
withResources('src/modules/ui-sticky');
});
beforeEach(() => {
component = StageComponent.
withResources('src/collections/ui-form');
});
beforeEach(() => {
component = StageComponent.
withResources('src/collections/ui-menu');
});
beforeEach(() => {
component = StageComponent.
withResources('src/collections/ui-breadcrumb');
});