Skip to content

Open-source AI browser agent for Chrome and Firefox (monorepo) 🧠

Fix billing payment notice review findings

Codex release-state testc6ef9e45b6c2
diff --git a/src/chrome/src/providers/openai.js b/src/chrome/src/providers/openai.js
index 5b9c25200..3ca144804 100644
--- a/src/chrome/src/providers/openai.js
+++ b/src/chrome/src/providers/openai.js
@@ -340,6 +340,14 @@ export class OpenAICompatibleProvider extends BaseLLMProvider {
return url.toString();
}
+ _webbrainAccountUrl() {
+ const url = new URL('https://api.webbrain.one/account');
+ if (this.config.deviceGuid) {
+ url.searchParams.set('client_reference_id', this.config.deviceGuid);
+ }
+ return url.toString();
+ }
+
_formatHttpError(status, body) {
const providerName = (this.config.providerName || '').toLowerCase();
if (status === 402 && providerName === 'webbrain-cloud') {
@@ -348,8 +356,8 @@ export class OpenAICompatibleProvider extends BaseLLMProvider {
let message = 'Daily free WebBrain Compass allowance used.';
try {
const parsed = JSON.parse(body || '{}');
- if (parsed.error?.code === 'webbrain_cloud_payment_failed' && parsed.manage_billing_url) {
- actionUrl = parsed.manage_billing_url;
+ if (parsed.error?.code === 'webbrain_cloud_payment_failed') {
+ actionUrl = parsed.manage_billing_url || this._webbrainAccountUrl();
actionLabel = 'Update payment method';
} else if (parsed.upgrade_url) {
actionUrl = parsed.upgrade_url;
diff --git a/src/chrome/src/ui/settings.js b/src/chrome/src/ui/settings.js
index 04c492f3d..0e1544a59 100644
--- a/src/chrome/src/ui/settings.js
+++ b/src/chrome/src/ui/settings.js
@@ -459,6 +459,7 @@ if (globalThis.chrome?.storage?.onChanged) {
const WEBBRAIN_SUBSCRIBE_URL = 'https://webbrain.one/subscribe';
const WEBBRAIN_ACCOUNT_URL = 'https://api.webbrain.one/account';
+const WEBBRAIN_BILLING_STATUS_URL = 'https://api.webbrain.one/v1/billing/status';
const DEFAULT_COST_ALLOWANCE_USD = 10;
const MAX_AGENT_STEPS_DEFAULT = 130;
@@ -3018,16 +3019,11 @@ async function refreshWebbrainPaymentNotice() {
const notice = providersContainer.querySelector('.webbrain-payment-notice');
const deviceGuid = providersData.webbrain_cloud?.deviceGuid;
if (!notice || !deviceGuid) return;
- try {
- const response = await fetch('https://api.webbrain.one/v1/billing/status', {
- headers: { 'X-WebBrain-Device-Id': deviceGuid },
- cache: 'no-store',
- credentials: 'omit',
- signal: AbortSignal.timeout(5000),
- });
- if (!response.ok) return;
- const status = await response.json();
- if (!notice.isConnected || !['past_due', 'unpaid'].includes(status.subscription_status)) return;
+ const billingStatusUrl = typeof WEBBRAIN_BILLING_STATUS_URL === 'string'
+ ? WEBBRAIN_BILLING_STATUS_URL
+ : 'https://api.webbrain.one/v1/billing/status';
+ const renderNotice = (subscriptionStatus) => {
+ if (!notice.isConnected || !['past_due', 'unpaid'].includes(subscriptionStatus)) return;
const message = document.createElement('p');
message.textContent = t('st.account.payment_failed');
const link = document.createElement('a');
@@ -3038,7 +3034,45 @@ async function refreshWebbrainPaymentNotice() {
notice.replaceChildren(message, link);
notice.style.cssText = 'margin-top:10px;padding:12px;border-radius:6px;border:1px solid var(--warning,#b7791f);';
notice.hidden = false;
- } catch { /* An unavailable billing check must not interrupt settings. */ }
+ };
+ // Per-session cache: renderProviders() runs on every search keystroke and the
+ // status only changes after a Stripe redirect, so reuse the last lookup.
+ const cached = refreshWebbrainPaymentNotice._cache;
+ if (cached?.deviceGuid === deviceGuid) {
+ renderNotice(cached.subscriptionStatus);
+ return;
+ }
+ try {
+ let statusPromise = refreshWebbrainPaymentNotice._inflight?.deviceGuid === deviceGuid
+ ? refreshWebbrainPaymentNotice._inflight.promise
+ : null;
+ if (!statusPromise) {
+ statusPromise = (async () => {
+ const response = await fetch(billingStatusUrl, {
+ headers: { 'X-WebBrain-Device-Id': deviceGuid },
+ cache: 'no-store',
+ credentials: 'omit',
+ signal: AbortSignal.timeout(5000),
+ });
+ if (!response.ok) return null;
+ const status = await response.json();
+ return status.subscription_status;
+ })();
+ refreshWebbrainPaymentNotice._inflight = { deviceGuid, promise: statusPromise };
+ }
+ const subscriptionStatus = await statusPromise;
+ if (refreshWebbrainPaymentNotice._inflight?.deviceGuid === deviceGuid) {
+ refreshWebbrainPaymentNotice._inflight = null;
+ }
+ if (subscriptionStatus == null) return;
+ refreshWebbrainPaymentNotice._cache = { deviceGuid, subscriptionStatus };
+ renderNotice(subscriptionStatus);
+ } catch {
+ if (refreshWebbrainPaymentNotice._inflight?.deviceGuid === deviceGuid) {
+ refreshWebbrainPaymentNotice._inflight = null;
+ }
+ /* An unavailable billing check must not interrupt settings. */
+ }
}
function renderProviders() {
diff --git a/src/chrome/src/ui/sidepanel.js b/src/chrome/src/ui/sidepanel.js
index 835293530..e6b31c6e9 100644
--- a/src/chrome/src/ui/sidepanel.js
+++ b/src/chrome/src/ui/sidepanel.js
@@ -11349,6 +11349,8 @@ function clearTransientAssistantTextForToolCall() {
// WebBrain Compass returns a 402 with one trailing billing action. Keep the
// matcher narrow so ordinary subscription text is not converted into billing UI.
const SUBSCRIBE_ERROR_RE = /(Subscribe for more usage|Upgrade to WebBrain Plus|Update payment method):\s*(https?:\/\/\S+)/i;
+const SUBSCRIBE_ACTION_LABELS = { upgrade: 'sp.subscribe.upgrade', payment: 'st.account.update_payment', subscribe: 'sp.subscribe.btn' };
+const SUBSCRIBE_RESUME_LABELS = { upgrade: 'sp.subscribe.resume_upgrade', payment: 'sp.subscribe.resume_payment', subscribe: 'sp.subscribe.resume' };
const COST_ALLOWANCE_ERROR_RE = /Cloud cost allowance reached:\s*(this session|total cloud\/router usage)\s+is\s+\$[\d.]+\s+against\s+the\s+\$([\d.]+)\s+limit\./i;
const COST_ALLOWANCE_BUMP_USD = 10;
@@ -11459,8 +11461,7 @@ function renderSubscribeError(textEl, content, resumeMode = '') {
const btn = document.createElement('button');
btn.type = 'button';
btn.className = 'subscribe-btn';
- btn.textContent = t(parsed.action === 'upgrade' ? 'sp.subscribe.upgrade' : 'sp.subscribe.btn');
- if (parsed.action === 'payment') btn.textContent = t('st.account.update_payment');
+ btn.textContent = t(SUBSCRIBE_ACTION_LABELS[parsed.action] || SUBSCRIBE_ACTION_LABELS.subscribe);
if (parsed.action === 'upgrade') btn.classList.add('subscribe-upgrade-btn');
btn.dataset.subscribeUrl = parsed.url;
btn.dataset.bound = 'true';
@@ -11470,8 +11471,7 @@ function renderSubscribeError(textEl, content, resumeMode = '') {
const resumeBtn = document.createElement('button');
resumeBtn.type = 'button';
resumeBtn.className = 'subscribe-resume-btn';
- resumeBtn.textContent = t(parsed.action === 'upgrade' ? 'sp.subscribe.resume_upgrade' : 'sp.subscribe.resume');
- if (parsed.action === 'payment') resumeBtn.textContent = t('sp.subscribe.resume_payment');
+ resumeBtn.textContent = t(SUBSCRIBE_RESUME_LABELS[parsed.action] || SUBSCRIBE_RESUME_LABELS.subscribe);
resumeBtn.dataset.resumeMode = ['ask', 'act', 'dev'].includes(resumeMode)
? resumeMode
: (textEl.closest('.message.assistant')?.dataset.runMode || agentMode);
diff --git a/src/firefox/src/providers/openai.js b/src/firefox/src/providers/openai.js
index c40c08b8e..aa2f74952 100644
--- a/src/firefox/src/providers/openai.js
+++ b/src/firefox/src/providers/openai.js
@@ -357,6 +357,14 @@ export class OpenAICompatibleProvider extends BaseLLMProvider {
return url.toString();
}
+ _webbrainAccountUrl() {
+ const url = new URL('https://api.webbrain.one/account');
+ if (this.config.deviceGuid) {
+ url.searchParams.set('client_reference_id', this.config.deviceGuid);
+ }
+ return url.toString();
+ }
+
_formatHttpError(status, body) {
const providerName = (this.config.providerName || '').toLowerCase();
if (status === 402 && providerName === 'webbrain-cloud') {
@@ -365,8 +373,8 @@ export class OpenAICompatibleProvider extends BaseLLMProvider {
let message = 'Daily free WebBrain Compass allowance used.';
try {
const parsed = JSON.parse(body || '{}');
- if (parsed.error?.code === 'webbrain_cloud_payment_failed' && parsed.manage_billing_url) {
- actionUrl = parsed.manage_billing_url;
+ if (parsed.error?.code === 'webbrain_cloud_payment_failed') {
+ actionUrl = parsed.manage_billing_url || this._webbrainAccountUrl();
actionLabel = 'Update payment method';
} else if (parsed.upgrade_url) {
actionUrl = parsed.upgrade_url;
diff --git a/src/firefox/src/ui/settings.js b/src/firefox/src/ui/settings.js
index f65099dca..1dcbfa8fe 100644
--- a/src/firefox/src/ui/settings.js
+++ b/src/firefox/src/ui/settings.js
@@ -435,6 +435,7 @@ if (globalThis.browser?.storage?.onChanged) {
const WEBBRAIN_SUBSCRIBE_URL = 'https://webbrain.one/subscribe';
const WEBBRAIN_ACCOUNT_URL = 'https://api.webbrain.one/account';
+const WEBBRAIN_BILLING_STATUS_URL = 'https://api.webbrain.one/v1/billing/status';
const DEFAULT_COST_ALLOWANCE_USD = 10;
const MAX_AGENT_STEPS_DEFAULT = 130;
@@ -2420,16 +2421,11 @@ async function refreshWebbrainPaymentNotice() {
const notice = providersContainer.querySelector('.webbrain-payment-notice');
const deviceGuid = providersData.webbrain_cloud?.deviceGuid;
if (!notice || !deviceGuid) return;
- try {
- const response = await fetch('https://api.webbrain.one/v1/billing/status', {
- headers: { 'X-WebBrain-Device-Id': deviceGuid },
- cache: 'no-store',
- credentials: 'omit',
- signal: AbortSignal.timeout(5000),
- });
- if (!response.ok) return;
- const status = await response.json();
- if (!notice.isConnected || !['past_due', 'unpaid'].includes(status.subscription_status)) return;
+ const billingStatusUrl = typeof WEBBRAIN_BILLING_STATUS_URL === 'string'
+ ? WEBBRAIN_BILLING_STATUS_URL
+ : 'https://api.webbrain.one/v1/billing/status';
+ const renderNotice = (subscriptionStatus) => {
+ if (!notice.isConnected || !['past_due', 'unpaid'].includes(subscriptionStatus)) return;
const message = document.createElement('p');
message.textContent = t('st.account.payment_failed');
const link = document.createElement('a');
@@ -2440,7 +2436,45 @@ async function refreshWebbrainPaymentNotice() {
notice.replaceChildren(message, link);
notice.style.cssText = 'margin-top:10px;padding:12px;border-radius:6px;border:1px solid var(--warning,#b7791f);';
notice.hidden = false;
- } catch { /* An unavailable billing check must not interrupt settings. */ }
+ };
+ // Per-session cache: renderProviders() runs on every search keystroke and the
+ // status only changes after a Stripe redirect, so reuse the last lookup.
+ const cached = refreshWebbrainPaymentNotice._cache;
+ if (cached?.deviceGuid === deviceGuid) {
+ renderNotice(cached.subscriptionStatus);
+ return;
+ }
+ try {
+ let statusPromise = refreshWebbrainPaymentNotice._inflight?.deviceGuid === deviceGuid
+ ? refreshWebbrainPaymentNotice._inflight.promise
+ : null;
+ if (!statusPromise) {
+ statusPromise = (async () => {
+ const response = await fetch(billingStatusUrl, {
+ headers: { 'X-WebBrain-Device-Id': deviceGuid },
+ cache: 'no-store',
+ credentials: 'omit',
+ signal: AbortSignal.timeout(5000),
+ });
+ if (!response.ok) return null;
+ const status = await response.json();
+ return status.subscription_status;
+ })();
+ refreshWebbrainPaymentNotice._inflight = { deviceGuid, promise: statusPromise };
+ }
+ const subscriptionStatus = await statusPromise;
+ if (refreshWebbrainPaymentNotice._inflight?.deviceGuid === deviceGuid) {
+ refreshWebbrainPaymentNotice._inflight = null;
+ }
+ if (subscriptionStatus == null) return;
+ refreshWebbrainPaymentNotice._cache = { deviceGuid, subscriptionStatus };
+ renderNotice(subscriptionStatus);
+ } catch {
+ if (refreshWebbrainPaymentNotice._inflight?.deviceGuid === deviceGuid) {
+ refreshWebbrainPaymentNotice._inflight = null;
+ }
+ /* An unavailable billing check must not interrupt settings. */
+ }
}
function renderProviders() {
diff --git a/src/firefox/src/ui/sidepanel.js b/src/firefox/src/ui/sidepanel.js
index 5d01786db..c95312d53 100644
--- a/src/firefox/src/ui/sidepanel.js
+++ b/src/firefox/src/ui/sidepanel.js
@@ -10992,6 +10992,8 @@ function clearTransientAssistantTextForToolCall() {
// WebBrain Compass returns a 402 with one trailing billing action. Keep the
// matcher narrow so ordinary subscription text is not converted into billing UI.
const SUBSCRIBE_ERROR_RE = /(Subscribe for more usage|Upgrade to WebBrain Plus|Update payment method):\s*(https?:\/\/\S+)/i;
+const SUBSCRIBE_ACTION_LABELS = { upgrade: 'sp.subscribe.upgrade', payment: 'st.account.update_payment', subscribe: 'sp.subscribe.btn' };
+const SUBSCRIBE_RESUME_LABELS = { upgrade: 'sp.subscribe.resume_upgrade', payment: 'sp.subscribe.resume_payment', subscribe: 'sp.subscribe.resume' };
const COST_ALLOWANCE_ERROR_RE = /Cloud cost allowance reached:\s*(this session|total cloud\/router usage)\s+is\s+\$[\d.]+\s+against\s+the\s+\$([\d.]+)\s+limit\./i;
const COST_ALLOWANCE_BUMP_USD = 10;
@@ -11102,8 +11104,7 @@ function renderSubscribeError(textEl, content, resumeMode = '') {
const btn = document.createElement('button');
btn.type = 'button';
btn.className = 'subscribe-btn';
- btn.textContent = t(parsed.action === 'upgrade' ? 'sp.subscribe.upgrade' : 'sp.subscribe.btn');
- if (parsed.action === 'payment') btn.textContent = t('st.account.update_payment');
+ btn.textContent = t(SUBSCRIBE_ACTION_LABELS[parsed.action] || SUBSCRIBE_ACTION_LABELS.subscribe);
if (parsed.action === 'upgrade') btn.classList.add('subscribe-upgrade-btn');
btn.dataset.subscribeUrl = parsed.url;
btn.dataset.bound = 'true';
@@ -11113,8 +11114,7 @@ function renderSubscribeError(textEl, content, resumeMode = '') {
const resumeBtn = document.createElement('button');
resumeBtn.type = 'button';
resumeBtn.className = 'subscribe-resume-btn';
- resumeBtn.textContent = t(parsed.action === 'upgrade' ? 'sp.subscribe.resume_upgrade' : 'sp.subscribe.resume');
- if (parsed.action === 'payment') resumeBtn.textContent = t('sp.subscribe.resume_payment');
+ resumeBtn.textContent = t(SUBSCRIBE_RESUME_LABELS[parsed.action] || SUBSCRIBE_RESUME_LABELS.subscribe);
resumeBtn.dataset.resumeMode = ['ask', 'act', 'dev'].includes(resumeMode)
? resumeMode
: (textEl.closest('.message.assistant')?.dataset.runMode || agentMode);
diff --git a/test/billing-payment-notice.mjs b/test/billing-payment-notice.mjs
index 04147abf4..6367799ac 100644
--- a/test/billing-payment-notice.mjs
+++ b/test/billing-payment-notice.mjs
@@ -5,7 +5,14 @@ import { fileURLToPath } from 'node:url';
for (const browser of ['chrome', 'firefox']) {
const settings = fs.readFileSync(new URL(`../src/${browser}/src/ui/settings.js`, import.meta.url), 'utf8');
+ assert.match(
+ settings,
+ /const WEBBRAIN_BILLING_STATUS_URL = 'https:\/\/api\.webbrain\.one\/v1\/billing\/status'/,
+ `${browser}: billing status URL must be hoisted as WEBBRAIN_BILLING_STATUS_URL`,
+ );
const source = settings.slice(settings.indexOf('async function refreshWebbrainPaymentNotice()'), settings.indexOf('function renderProviders()'));
+ assert.match(source, /WEBBRAIN_BILLING_STATUS_URL/, `${browser}: refresh must use the hoisted billing URL constant`);
+ assert.match(source, /_cache/, `${browser}: refresh must reuse a per-session billing cache`);
const en = (await import(new URL(`../src/${browser}/src/ui/locales/en.js`, import.meta.url))).default;
const tr = (await import(new URL(`../src/${browser}/src/ui/locales/tr.js`, import.meta.url))).default;
@@ -19,6 +26,7 @@ for (const browser of ['chrome', 'firefox']) {
document: { createElement: tag => ({ tag }) },
t: key => (options.locale === 'tr' ? tr : en)[key],
webbrainAccountUrl: device => `https://api.webbrain.one/account?client_reference_id=${encodeURIComponent(device)}`,
+ WEBBRAIN_BILLING_STATUS_URL: 'https://api.webbrain.one/v1/billing/status',
fetch: async (url, config) => {
requests.push({ url, config });
if (options.failure) throw new Error('offline');
@@ -52,6 +60,33 @@ for (const browser of ['chrome', 'firefox']) {
assert.equal((await render('past_due', { deviceGuid: '' })).requests.length, 0, 'No billing request without a device identity');
assert.equal((await render('past_due', { locale: 'tr' })).notice.children[1].textContent, 'Ödeme yöntemini güncelle');
+ {
+ let fetchCount = 0;
+ let currentNotice = { hidden: true, isConnected: true, style: {}, children: [], replaceChildren(...children) { this.children = children; } };
+ const cacheContext = vm.createContext({
+ providersContainer: { querySelector: () => currentNotice },
+ providersData: { webbrain_cloud: { deviceGuid: 'test-browser', baseUrl: 'https://untrusted.example/v1' } },
+ AbortSignal,
+ document: { createElement: tag => ({ tag }) },
+ t: key => en[key],
+ webbrainAccountUrl: device => `https://api.webbrain.one/account?client_reference_id=${encodeURIComponent(device)}`,
+ WEBBRAIN_BILLING_STATUS_URL: 'https://api.webbrain.one/v1/billing/status',
+ fetch: async (url) => {
+ fetchCount += 1;
+ assert.equal(url, 'https://api.webbrain.one/v1/billing/status');
+ return { ok: true, json: async () => ({ subscription_status: 'past_due' }) };
+ },
+ });
+ vm.runInContext(source, cacheContext, { filename: fileURLToPath(new URL(`../src/${browser}/src/ui/settings.js`, import.meta.url)) });
+ await vm.runInContext('refreshWebbrainPaymentNotice()', cacheContext);
+ assert.equal(currentNotice.hidden, false, `${browser}: first render must show a payment warning`);
+ assert.equal(fetchCount, 1, `${browser}: first render must fetch billing status`);
+ currentNotice = { hidden: true, isConnected: true, style: {}, children: [], replaceChildren(...children) { this.children = children; } };
+ await vm.runInContext('refreshWebbrainPaymentNotice()', cacheContext);
+ assert.equal(currentNotice.hidden, false, `${browser}: cached second render must still show a payment warning`);
+ assert.equal(fetchCount, 1, `${browser}: second renderProviders() must reuse the per-session billing cache`);
+ }
+
const { OpenAICompatibleProvider: OpenAIProvider } = await import(new URL(`../src/${browser}/src/providers/openai.js`, import.meta.url));
const provider = new OpenAIProvider({ providerName: 'webbrain-cloud', deviceGuid: 'test-browser' });
const error = provider._formatHttpError(402, JSON.stringify({
@@ -60,14 +95,26 @@ for (const browser of ['chrome', 'firefox']) {
}));
assert.match(error, /Update payment method: https:\/\/api.webbrain.one\/portal/);
assert.doesNotMatch(error, /Subscribe for more usage|buy.stripe.com/);
+ const fallbackError = provider._formatHttpError(402, JSON.stringify({
+ error: { code: 'webbrain_cloud_payment_failed', message: 'Your payment could not be completed.' },
+ }));
+ assert.match(fallbackError, /Update payment method: https:\/\/api\.webbrain\.one\/account\?client_reference_id=test-browser/);
+ assert.doesNotMatch(fallbackError, /Subscribe for more usage|Upgrade to WebBrain Plus/);
const panel = fs.readFileSync(new URL(`../src/${browser}/src/ui/sidepanel.js`, import.meta.url), 'utf8');
+ assert.match(panel, /const SUBSCRIBE_ACTION_LABELS = \{[^}]*payment:\s*'st\.account\.update_payment'[^}]*\}/, `${browser}: sidepanel must map payment action to update_payment label`);
+ assert.match(panel, /const SUBSCRIBE_RESUME_LABELS = \{[^}]*payment:\s*'sp\.subscribe\.resume_payment'[^}]*\}/, `${browser}: sidepanel must map payment action to resume_payment label`);
const declaration = panel.slice(panel.indexOf('const SUBSCRIBE_ERROR_RE'), panel.indexOf('\n', panel.indexOf('const SUBSCRIBE_ERROR_RE')));
+ const actionLabelsSrc = panel.slice(panel.indexOf('const SUBSCRIBE_ACTION_LABELS'), panel.indexOf('\n', panel.indexOf('const SUBSCRIBE_ACTION_LABELS')));
+ const resumeLabelsSrc = panel.slice(panel.indexOf('const SUBSCRIBE_RESUME_LABELS'), panel.indexOf('\n', panel.indexOf('const SUBSCRIBE_RESUME_LABELS')));
const parser = panel.slice(panel.indexOf('function parseSubscribeError(content)'), panel.indexOf('function openSubscribeUrl'));
const parse = vm.runInNewContext(`${declaration}\n${parser}\nparseSubscribeError`);
const parsed = parse(error);
assert.equal(parsed.action, 'payment');
assert.equal(parsed.url, 'https://api.webbrain.one/portal?client_reference_id=test-browser');
assert.equal(parse('Just talking about a payment method'), null);
+ const parsedFallback = parse(fallbackError);
+ assert.equal(parsedFallback.action, 'payment');
+ assert.equal(parsedFallback.url, 'https://api.webbrain.one/account?client_reference_id=test-browser');
const element = () => ({
children: [], dataset: {}, classList: { add() {} },
replaceChildren(...children) { this.children = children; },
@@ -75,7 +122,8 @@ for (const browser of ['chrome', 'firefox']) {
addEventListener() {}, closest() { return null; },
});
const cardSource = panel.slice(panel.indexOf('function renderSubscribeError('), panel.indexOf('function renderCostAllowanceError('));
- const renderCard = vm.runInNewContext(`${cardSource}\nrenderSubscribeError`, {
+ assert.doesNotMatch(cardSource, /if \(parsed\.action === 'payment'\)/, `${browser}: renderSubscribeError must use label maps, not double assignment`);
+ const renderCard = vm.runInNewContext(`${declaration}\n${actionLabelsSrc}\n${resumeLabelsSrc}\n${cardSource}\nrenderSubscribeError`, {
parseSubscribeError: parse, document: { createElement: element }, t: key => en[key],
});
const card = element();
@@ -83,5 +131,9 @@ for (const browser of ['chrome', 'firefox']) {
assert.equal(card.children[1].children[0].textContent, en['st.account.update_payment']);
assert.equal(card.children[1].children[1].textContent, en['sp.subscribe.resume_payment']);
assert.equal(card.children[1].children[1].dataset.resumeMode, 'ask');
+ const fallbackCard = element();
+ assert.equal(renderCard(fallbackCard, fallbackError, 'ask'), true);
+ assert.equal(fallbackCard.children[1].children[0].textContent, en['st.account.update_payment']);
+ assert.equal(fallbackCard.children[1].children[1].textContent, en['sp.subscribe.resume_payment']);
}
console.log('billing-payment-notice ok (Chrome + Firefox)');