Skip to content

Commit

Permalink
Fix stores bug (#851)
Browse files Browse the repository at this point in the history
  • Loading branch information
brunobar79 authored Aug 13, 2023
1 parent 1251132 commit 6d0e1c4
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 54 deletions.
104 changes: 52 additions & 52 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,58 +68,58 @@ jobs:
name: rainbowbx-${{ github.sha }}.zip
path: build/
# FIREFOX TESTS - Disabled for now till all tests are passing
# firefox-e2e-parallel:
# runs-on: ubuntu-latest
# timeout-minutes: 16
# needs: [build]
# env:
# DISPLAY: :0
# VITEST_SEGFAULT_RETRY: 4
# steps:
# - uses: actions/checkout@v3
# - uses: actions/setup-node@v3
# with:
# node-version: "16.20.0"
# - name: Download deps cache artifacts
# uses: actions/download-artifact@v3
# with:
# name: node_modules.tar.gz
# - name: Unzip node_modules
# shell: 'bash'
# run: tar xzf node_modules.tar.gz
# - name: Download build artifacts
# uses: actions/download-artifact@v3
# with:
# name: rainbowbx-${{ github.sha }}.zip
# path: build
# - name: Setup xvfb
# shell: 'bash'
# run: |
# sudo apt-get install -y xvfb libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xinput0 libxcb-xfixes0
# # start xvfb in the background
# sudo /usr/bin/Xvfb $DISPLAY -screen 0 1280x1024x24 &
# - name: Install Anvil
# uses: foundry-rs/foundry-toolchain@v1
# with:
# version: nightly
# - uses: browser-actions/setup-firefox@v1
# with:
# firefox-version: 'latest-devedition'
# - uses: actions/checkout@v3
# with:
# repository: 'rainbow-me/browser-extension-env'
# token: ${{ secrets.DOTENV_GITHUB_ACCESS_TOKEN }}
# path: tmp
# - name: Copy dotenv
# shell: 'bash'
# run: cat tmp/dotenv >> .env && rm -rf tmp
# - name: Run e2e parallel (Firefox)
# run: |
# export BROWSER=firefox
# export OS=linux
# export FIREFOX_BIN=/opt/hostedtoolcache/firefox/latest-devedition/x64/firefox
# yarn firefox:manifest && yarn firefox:zip
# yarn vitest e2e/parallel/newWalletFlow.test.ts --config ./e2e/parallel/vitest.config.ts
firefox-e2e-parallel:
runs-on: ubuntu-latest
timeout-minutes: 16
needs: [build]
env:
DISPLAY: :0
VITEST_SEGFAULT_RETRY: 4
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "16.20.0"
- name: Download deps cache artifacts
uses: actions/download-artifact@v3
with:
name: node_modules.tar.gz
- name: Unzip node_modules
shell: 'bash'
run: tar xzf node_modules.tar.gz
- name: Download build artifacts
uses: actions/download-artifact@v3
with:
name: rainbowbx-${{ github.sha }}.zip
path: build
- name: Setup xvfb
shell: 'bash'
run: |
sudo apt-get install -y xvfb libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xinput0 libxcb-xfixes0
# start xvfb in the background
sudo /usr/bin/Xvfb $DISPLAY -screen 0 1280x1024x24 &
- name: Install Anvil
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
- uses: browser-actions/setup-firefox@v1
with:
firefox-version: 'latest-devedition'
- uses: actions/checkout@v3
with:
repository: 'rainbow-me/browser-extension-env'
token: ${{ secrets.DOTENV_GITHUB_ACCESS_TOKEN }}
path: tmp
- name: Copy dotenv
shell: 'bash'
run: cat tmp/dotenv >> .env && rm -rf tmp
- name: Run e2e parallel (Firefox)
run: |
export BROWSER=firefox
export OS=linux
export FIREFOX_BIN=/opt/hostedtoolcache/firefox/latest-devedition/x64/firefox
yarn firefox:manifest && yarn firefox:zip
yarn vitest:parallel --retry=5
# CHROME TESTS
chrome-e2e-parallel:
runs-on: ubuntu-latest
Expand Down
3 changes: 2 additions & 1 deletion e2e/parallel/watchWalletFlow.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
findElementByTestIdAndClick,
findElementByText,
getExtensionIdByName,
getRootUrl,
getTextFromText,
goToPopup,
goToWelcome,
Expand All @@ -24,7 +25,7 @@ import {
} from '../helpers';
import { TEST_VARIABLES } from '../walletVariables';

let rootURL = 'chrome-extension://';
let rootURL = getRootUrl();
let driver: WebDriver;

const browser = process.env.BROWSER || 'chrome';
Expand Down
3 changes: 2 additions & 1 deletion src/core/storage/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ export const Storage = {
const listener = (changes: {
[key: string]: chrome.storage.StorageChange;
}) => {
if (!changes[key]) return;
if (!changes[key] || changes[key]?.newValue === changes[key]?.oldValue)
return;
const newValue = changes[key]?.newValue;
const oldValue = changes[key]?.oldValue;
callback(newValue, oldValue);
Expand Down

0 comments on commit 6d0e1c4

Please sign in to comment.