Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: remove act warnings for allowance-menu & lnurl-pay #1603

Merged
merged 4 commits into from
Oct 16, 2022

Conversation

lisabaut
Copy link
Contributor

@lisabaut lisabaut commented Oct 10, 2022

Describe the changes you have made in this PR

A quick fix for the test warnings (e.g. here):

  • properly mock getFiatValue
  • fix: initial value for "budget" in component AllowanceMenu
  • fix: call getFiatValue only if sat value is defined
  • test how many times getFiatValue was called

Test run: The warnings are gone => https://github.com/getAlby/lightning-browser-extension/actions/runs/3220138671

Type of change

  • fix: Bug fix (non-breaking change which fixes an issue)

How has this been tested?

Simply by running yarn test:unit only.

Checklist

  • My code follows the style guidelines of this project and performed a self-review of my own code
  • New and existing tests pass locally with my changes
  • I checked if I need to make corresponding changes to the documentation (and made those changes if needed)

@github-actions
Copy link

🚀 Thanks for the pull request!

Here are the current build files for testing:

Download and unzip the file for your browser. Refer to the readme for detailed install instructions.


This build is brought to you by: Adam Fiscor (who recently dropped 1337 sats):

The future is bright. We just have a lot of work to do.

Want to sponsor the next build? send some sats to ⚡️builds@getalby.com (don't forget to provide your name)

Don't forget: keep stacking sats!

const [lnurlAuth, setLnurlAuth] = useState(false);
const [fiatAmount, setFiatAmount] = useState("");
const { t } = useTranslation("components", { keyPrefix: "allowance_menu" });
const { t: tCommon } = useTranslation("common");

useEffect(() => {
if (budget !== "" && showFiat) {
(async () => {
const getFiat = async () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah! We do this in several places. This is better. Good to know, thanks!

@bumi bumi merged commit b04010c into master Oct 16, 2022
@bumi bumi deleted the fix-test-allowance-menu branch October 16, 2022 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants