---
# System prepended metadata

title: Ethical metrics E2E test

---

# Ethical metrics E2E test

### Setup

- Setup ethical metrics dappmanager cron to 2 min
- Comment the dms pkg checker in ethical metrics cron

**Dappmanager Ipfs hash** `/ipfs/QmfTpBLzoSdrG88ETRnDus27DTDRUrTXyyVmhXDuMNYVaN`
**Ethical metrics Ipfs hash** http://my.dappnode/installer/public/%2Fipfs%2FQmPivgVmJtAGGQjUG1AFian4aXViBJyQ2xK5j4ddDE8v1o

### Test

#### Migration test

//TODO

#### Onboarding view

- [x] Test regex
    - [x] Email
    - [x] Telegram
    - [x] Combination of above
- [x] User updating core with Ethical metrics installed
    - [x] Show modal with update button
        - [x] Update button disabled if regex does not match
    - [x] 2 Fields: tgchannelid and email (email should be there)
    - [x] Test if user updates tgChannelId and/or email it gets registered successfully
- [ ] User updating core without Ethical metrics installed
    - [ ] Show switch (in off), asking user to enable ethical metrics
    - [ ] If click on then ethical metrics should be enabled: user registered with tgChannelid and/or email
    - [ ] Switch disabled if regex does not match

#### Notifications view

- [x] Test regex
    - [x] Email
    - [x] Telegram
    - [x] Combination of above
- [ ] Follow onboarding test
    - [x] Test update button for telegram
    - [x] Test update button for email
    - [ ] 

#### Infra


#### Notes

- [x] - Add a short copy about what the user is about to download and redirect them to the docs @MGC (https://docs.dappnode.io/docs/user/ethical-metrics/overview)
- Review the notifications copies from proxy @pablo
- Migrate ethical-metrics db and set pending ethical metrics new feature (implement it in `initializeDb`) @MG 
```js 
  if (db.ethicalMetrics.get() === null) {
    db.ethicalMetrics.set({
      enabled: db.ethicalMetricsStatus.get(),
      mail: db.ethicalMetricsMail.get(),
      tgChannelId: null
    });

    db.newFeatureStatus.set("enable-ethical-metrics", "pending")
  }

```
- [x] - Disable button update ALWAYS if at least one regex matches OR no changes! @MG 
- [x] - Disable update button after user clicked on update by fetching content again. Use `await ethicalMetricsConfig.revalidate()` @MG
- Edit copy in notifications. @MG
    - Remove CPU alerts
    - Edit Dappnode down notification: dappnode down for at least 6 hours
- Set same behaviour to the notifications switch as the switch from the onboarding. Add a tooltip @MG
- Update ethical data after subscribe/unsubscribe @MG
- Add a confirm component when user clicks on OFF: "You are about to unsubscribe from ethical metrics.." @MG
- Fix email blocklist @pablo 
