-
Notifications
You must be signed in to change notification settings - Fork 440
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: e2e failing when crx name is set to Fuel Wallet (#1509)
- Fixed e2e flakiness due to the use of wrong connector/VITE_CRX_NAME pair - Adds errors warning when required env var is not set
- Loading branch information
1 parent
0d135e6
commit 773c5b9
Showing
2 changed files
with
26 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"fuels-wallet": patch | ||
--- | ||
|
||
Fixed e2e flakiness due to the use of wrong connector/VITE_CRX_NAME pair |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,27 @@ | ||
import { FuelWalletDevelopmentConnector } from '@fuels/connectors'; | ||
import { Address, Fuel, Provider } from 'fuels'; | ||
import { | ||
FuelWalletConnector, | ||
FuelWalletDevelopmentConnector, | ||
} from '@fuels/connectors'; | ||
import { Address, Fuel } from 'fuels'; | ||
import { VITE_CRX_NAME } from '../src/config'; | ||
|
||
localStorage.clear(); | ||
|
||
const connectors = []; | ||
|
||
// Do not change this. This fixes e2e flakyness triggered by different env variables. | ||
switch (VITE_CRX_NAME) { | ||
case 'Fuel Wallet Development': | ||
connectors.push(new FuelWalletDevelopmentConnector()); | ||
break; | ||
case 'Fuel Wallet': | ||
connectors.push(new FuelWalletConnector()); | ||
break; | ||
default: | ||
throw new Error('VITE_CRX_NAME is not set to a valid value'); | ||
} | ||
|
||
window.fuel = new Fuel({ | ||
connectors: [new FuelWalletDevelopmentConnector()], | ||
connectors, | ||
}); | ||
|
||
window.createAddress = (address: string) => Address.fromString(address); |