Skip to content

Commit

Permalink
Fix retrieval of a missing l10n for action
Browse files Browse the repository at this point in the history
PR-URL: #403
  • Loading branch information
belochub committed Apr 8, 2019
1 parent 383754f commit 4ba170b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/provider.js
Original file line number Diff line number Diff line change
Expand Up @@ -721,6 +721,7 @@ class StorageProvider {
`No ${langTag} localization data for ${category}.${action} action`
)
);
return;
}
process.nextTick(callback, null, l10n);
}
Expand Down
4 changes: 4 additions & 0 deletions test/fixtures/resources/Category.AnotherAction.action
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Action({
Params: {},
Execute: async () => {},
})
11 changes: 10 additions & 1 deletion test/ms.resources.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ metatests.test('StorageProvider supports localization methods', async test => {

const provider = new StorageProvider({});
provider.open({ schema }, () => {
test.plan(23);
test.plan(24);
provider.getCommonL10n('en', (err, l10n) => {
test.error(err);
test.strictSame(l10n, '{"Id":"Identifier"}');
Expand Down Expand Up @@ -142,6 +142,15 @@ metatests.test('StorageProvider supports localization methods', async test => {
)
);
});
provider.getActionL10n('uk', 'Category', 'AnotherAction', err => {
test.isError(
err,
new GSError(
errorCodes.NOT_FOUND,
`No uk localization data for Category.AnotherAction action`
)
);
});

provider.getCategoryL10n('uk', 'Category', err => {
test.isError(
Expand Down

0 comments on commit 4ba170b

Please sign in to comment.