There's a couple things you can do here but it depends on whether load
is an action or not. There may be other ways to test this as well, but these are the most common methods I use.
If load
is an action and is triggered by a DOM event (i.e., clicking a button) then you can trigger the function by performing that DOM event in your integration test:
test('should render some information', async function(assert) {
await render(hbs`{{componentA}}`);
// if a button has the action modifier:
// <button {{action "load"}}>Click me</button>
// then you can do this in your test to trigger the action:
await click('button');
// assertions go here
});
If it's simply a regular function in the component and you want to call this function manually on an instance of the component you could try doing so in a component unit test. The only gotcha here is that you won't be able to assert any DOM changes.
test('should do something', function(assert) {
const component = this.owner.factoryFor('component:componentA').create();
component.load();
// assertions go here
});