it('should render correctly with "type" attribute equal to "error"', () => { const tree = renderer .create( <BpkBannerAlertInner type={ALERT_TYPES.ERROR} message={message} />, ) .toJSON(); expect(tree).toMatchSnapshot(); });
const canPayExpense = async (req, expense): Promise<boolean> => { if (![expenseStatus.APPROVED, expenseStatus.ERROR].includes(expense.status)) { return false; } else if (!canUseFeature(req.remoteUser, FEATURE.EXPENSES)) { return false; } else { return isHostAdmin(req, expense); } }
async uninstallNewPlugin(dir, pluginName, version) { let result = await utils.isNewVersionPlugin(pluginName, version) if (result) { await this.handleUninstall(dir, pluginName, version, result) if (this.shouldUninstallPackage) { await this.uninstallInPackage(dir, pluginName) } } else { this.emit(LOGLEVEL.ERROR, `This package of weex is not support anymore! Please choose other package.`) } }
function AlertReducer(state = {}, action) { switch (action.type) { case alertConstants.SUCCESS: return {type:"success", message:action.message}; case alertConstants.ERROR: return {type:"danger",message:action.error}; case alertConstants.CLEAR: return {}; default: return state; } }
export function setError(message: string) { return { type: constants.ERROR, payload: message, error: true, }; }
tape('SPLIT LOGGER FACTORY / Logger class public methods behaviour - instance.error', assert => { testLogLevels(LogLevels.ERROR, assert, true); assert.end(); });
/** * Notify listeners about the failure to successfully execute the assigned consumer function * @param {Object} err - error * @private */ handleConsumptionFailure(err) { this.stats.failureCount++; this.eventHandlers[EVENTS.ERROR](err); }
it('should render correctly with "type" attribute equal to "error" and "icon" equal to CurrencyIcon', () => { const tree = renderer .create( <BpkBannerAlertInner type={ALERT_TYPES.ERROR} message={message} icon={CurrencyIcon} />, ) .toJSON(); expect(tree).toMatchSnapshot(); });
it('should render correctly with "type" attribute equal to "error" and "icon" equal to CurrencyIcon', () => { const tree = renderer .create( <BpkBannerAlertInner type={ALERT_TYPES.ERROR} message={message} icon={CurrencyIcon} />, ) .toJSON(); expect(tree).toMatchSnapshot(); });
it('should render correctly with "type" attribute equal to "error"', () => { const tree = renderer .create( <BpkBannerAlertInner type={ALERT_TYPES.ERROR} message={message} />, ) .toJSON(); expect(tree).toMatchSnapshot(); });
export function setError(message: string) { return { type: constants.ERROR, payload: message, error: true, }; }
export function setError(message: string) { return { type: constants.ERROR, payload: message, error: true, }; }
export function setError(message: string) { return { type: constants.ERROR, payload: message, error: true, }; }
export function setError(message: string) { return { type: constants.ERROR, payload: message, error: true, }; }
export function setError(message: string) { return { type: constants.ERROR, payload: message, error: true, }; }