Skip to content

Commit

Permalink
Assign found OAM array to foundManuscript instead of push
Browse files Browse the repository at this point in the history
  • Loading branch information
rpoet-jh committed Sep 4, 2024
1 parent efe3372 commit 0b0cf4d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/components/found-manuscripts/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export default class FoundManuscriptsComponent extends Component {
const foundOAMss = yield this.oaManuscriptService.lookup(doi);

if (foundOAMss) {
this.foundManuscripts.push(foundOAMss);
this.foundManuscripts = [...foundOAMss];
}
};
}
10 changes: 6 additions & 4 deletions tests/integration/components/found-manuscripts/component-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,12 @@ module('Integration | Component | found-manuscripts', (hooks) => {
const mockMsService = Service.extend({
lookup(doi) {
assert.ok(doi, 'DOI needs to be present');
return Promise.resolve({
name: 'This is a moo',
url: 'http://moo.example.com',
});
return Promise.resolve([
{
name: 'This is a moo',
url: 'http://moo.example.com',
},
]);
},
});

Expand Down

0 comments on commit 0b0cf4d

Please sign in to comment.