Bug 1764690 - [devtools] Check data-l10n-args attribute value instead of context menu label in storage tests. r=bomsy.

These tests are failing intermittently as, I think, the label gets localized
asynchronously.
So instead of checking the computed translated string, we only check that the
attribute for the item name is properly set.

Differential Revision: https://phabricator.services.mozilla.com/D144163
This commit is contained in:
Nicolas Chevobbe 2022-04-21 13:08:56 +00:00
parent 7353e17494
commit 1ac5da6a36
2 changed files with 6 additions and 2 deletions

View File

@ -63,7 +63,9 @@ add_task(async function() {
.replace(SEPARATOR_GUID, "-")
.substr(0, 16);
ok(
menuDeleteItem.getAttribute("label").includes(truncatedRowName),
JSON.parse(
menuDeleteItem.getAttribute("data-l10n-args")
).itemName.includes(truncatedRowName),
`Context menu item label contains '${rowName}' (maybe truncated)`
);
});

View File

@ -216,7 +216,9 @@ add_task(async function() {
.replace(SEPARATOR_GUID, "-")
.substr(0, 16);
ok(
menuDeleteItem.getAttribute("label").includes(truncatedRowName),
JSON.parse(
menuDeleteItem.getAttribute("data-l10n-args")
).itemName.includes(truncatedRowName),
`Context menu item label contains '${rowName}' (maybe truncated)`
);
});