From ba096ccae11196ed3bbba05372dfa9e248e9dee0 Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Sun, 26 Apr 2026 07:38:06 -0400 Subject: [PATCH 1/4] Update GitHub Actions for Node 24 runtime --- .github/workflows/pr.yaml | 8 ++++---- .github/workflows/push.yaml | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 5581c18..ddf09bc 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -6,9 +6,9 @@ jobs: Test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v6 - name: Setup Node - uses: actions/setup-node@v3 + uses: actions/setup-node@v6 with: node-version: 14 - name: Install dependencies @@ -23,8 +23,8 @@ jobs: runs-on: ubuntu-latest name: Check formatting steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v6 + - uses: actions/setup-node@v6 with: node-version: 16 - run: npm install diff --git a/.github/workflows/push.yaml b/.github/workflows/push.yaml index 14e90fd..7b3d9f6 100644 --- a/.github/workflows/push.yaml +++ b/.github/workflows/push.yaml @@ -6,9 +6,9 @@ jobs: Publish: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v6 - name: Setup Node - uses: actions/setup-node@v3 + uses: actions/setup-node@v6 with: node-version: 14 - name: Install dependencies @@ -20,7 +20,7 @@ jobs: - name: Build static site run: CI="" npm run build - name: Deploy to GItHub Pages - uses: JamesIves/github-pages-deploy-action@releases/v3 + uses: JamesIves/github-pages-deploy-action@v4 with: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} BRANCH: gh-pages From 490e19c7a02b28004a8ac3f9d7a7b9f229a1dad5 Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Sun, 26 Apr 2026 10:33:45 -0400 Subject: [PATCH 2/4] Clean up CI warnings --- .github/workflows/pr.yaml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index ddf09bc..ea4c791 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -28,6 +28,5 @@ jobs: with: node-version: 16 - run: npm install - - uses: sibiraj-s/action-eslint@v2 - with: - eslint-args: "src" + - name: Run ESLint + run: npx eslint src From 4a7c78bb474589999c0c67ee059e7b30f279a627 Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Sun, 26 Apr 2026 10:38:54 -0400 Subject: [PATCH 3/4] Remove unused expenditure class --- src/App.js | 59 ------------------------------------------------------ 1 file changed, 59 deletions(-) diff --git a/src/App.js b/src/App.js index d217c74..eec59ad 100644 --- a/src/App.js +++ b/src/App.js @@ -16,65 +16,6 @@ class HouseholdInfo { } } -class ExpenditureInfo{ - constructor({new_clean_vehicle_classification, - new_clean_vehicle_msrp, - purchased_qualifying_new_clean_vehicle, used_clean_vehicle_sale_price,residential_efficiency_electrification_retrofit_expenditures, - residential_efficiency_electrification_retrofit_energy_savings, - home_energy_audit_expenditures, - energy_efficient_door_expenditures, - energy_efficient_insulation_expenditures, - energy_efficient_roof_expenditures, - energy_efficient_window_expenditures, - advanced_main_air_circulating_fan_expenditures, - air_sealing_ventilation_expenditures, - biomass_stove_boiler_expenditures, - electric_heat_pump_clothes_dryer_expenditures, - electric_load_service_center_upgrade_expenditures, - electric_stove_cooktop_range_or_oven_expenditures, - electric_wiring_expenditures, - energy_efficient_central_air_conditioner_expenditures, - heat_pump_expenditures, - heat_pump_water_heater_expenditures, - qualified_furnace_or_hot_water_boiler_expenditures, - fuel_cell_property_capacity, - fuel_cell_property_expenditures, - geothermal_heat_pump_property_expenditures, - qualified_battery_storage_technology_expenditures, - small_wind_energy_property_expenditures, - solar_electric_property_expenditures, - solar_water_heating_property_expenditures}){ - this.new_clean_vehicle_classification = new_clean_vehicle_classification; - this.new_clean_vehicle_msrp = new_clean_vehicle_msrp; - this.purchased_qualifying_new_clean_vehicle = purchased_qualifying_new_clean_vehicle; - this.used_clean_vehicle_sale_price = used_clean_vehicle_sale_price; - this.residential_efficiency_electrification_retrofit_expenditures = residential_efficiency_electrification_retrofit_expenditures; - this.residential_efficiency_electrification_retrofit_energy_savings = residential_efficiency_electrification_retrofit_energy_savings; - this.home_energy_audit_expenditures = home_energy_audit_expenditures; - this.energy_efficient_door_expenditures = energy_efficient_door_expenditures; - this.energy_efficient_insulation_expenditures = energy_efficient_insulation_expenditures; - this.energy_efficient_roof_expenditures = energy_efficient_roof_expenditures; - this.energy_efficient_window_expenditures = energy_efficient_window_expenditures; - this.air_sealing_ventilation_expenditures = air_sealing_ventilation_expenditures; - this.biomass_stove_boiler_expenditures = biomass_stove_boiler_expenditures; - this.advanced_main_air_circulating_fan_expenditures = advanced_main_air_circulating_fan_expenditures; - this.electric_heat_pump_clothes_dryer_expenditures = electric_heat_pump_clothes_dryer_expenditures; - this.electric_load_service_center_upgrade_expenditures = electric_load_service_center_upgrade_expenditures; - this.electric_stove_cooktop_range_or_oven_expenditures = electric_stove_cooktop_range_or_oven_expenditures; - this.electric_wiring_expenditures = electric_wiring_expenditures; - this.energy_efficient_central_air_conditioner_expenditures = energy_efficient_central_air_conditioner_expenditures; - this.heat_pump_expenditures = heat_pump_expenditures; - this.heat_pump_water_heater_expenditures = heat_pump_water_heater_expenditures; - this.qualified_furnace_or_hot_water_boiler_expenditures = qualified_furnace_or_hot_water_boiler_expenditures; - this.fuel_cell_property_capacity = fuel_cell_property_capacity; - this.fuel_cell_property_expenditures = fuel_cell_property_expenditures; - this.geothermal_heat_pump_property_expenditures = geothermal_heat_pump_property_expenditures; - this.qualified_battery_storage_technology_expenditures = qualified_battery_storage_technology_expenditures; - this.small_wind_energy_property_expenditures = small_wind_energy_property_expenditures; - this.solar_electric_property_expenditures = solar_electric_property_expenditures; - this.solar_water_heating_property_expenditures = solar_water_heating_property_expenditures; - } -} function App() { // TODO: begin with a null household in the PR that creates Household component. From c2c4651407da7101271aa479830beb5eff6cd63f Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Sun, 26 Apr 2026 13:14:05 -0400 Subject: [PATCH 4/4] Update clean vehicle credit test --- src/App.test.js | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/src/App.test.js b/src/App.test.js index ccb0b2c..6ba064f 100644 --- a/src/App.test.js +++ b/src/App.test.js @@ -1,11 +1,28 @@ -import { render, screen, act } from '@testing-library/react'; +import { fireEvent, render, screen, waitFor } from '@testing-library/react'; import App from './App'; -test('reaches correct result', async () => { - act(() => { // eslint-disable-line - render(); +test('shows clean vehicle credit result', async () => { + window.fetch = jest.fn(() => + Promise.resolve({ + json: () => + Promise.resolve({ + tax_units: { + tax_unit: { + new_clean_vehicle_credit: { 2023: 7500 }, + }, + }, + }), + }) + ); + + render(); + fireEvent.click(screen.getByRole('button', { name: /simulate ev credits/i })); + + await waitFor(() => { + expect( + screen.getByText( + "You're eligible: your eligible new clean vehicle credit is $7500." + ) + ).toBeInTheDocument(); }); - await new Promise((r) => setTimeout(r, 2000)); - const linkElement = screen.getByText("The heat pump rebate for $10k in heat pump expenditures in 2023 is $8000."); - expect(linkElement).toBeInTheDocument(); });