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

chore(deps): install ynap-parsers from npmjs #1576

Merged
merged 2 commits into from
Mar 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 2 additions & 10 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@ jobs:
node-version: '20'
cache: 'npm'

- name: set npm auth
run: echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" >> ~/.npmrc

- name: install node modules
run: npm ci

Expand All @@ -54,7 +51,7 @@ jobs:
# Current backend version as service container
services:
backend:
image: ghcr.io/envelope-zero/backend:v5.1.0
image: ghcr.io/envelope-zero/backend:v5.1.3
env:
CORS_ALLOW_ORIGINS: http://localhost:3000
API_URL: http://localhost:3000/api
Expand All @@ -70,17 +67,13 @@ jobs:
- name: Checkout
uses: actions/checkout@v4.1.1

- name: Set npm auth
run: echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" >> ~/.npmrc

- name: Run cypress
uses: cypress-io/github-action@v6.6.1
timeout-minutes: 5
with:
start: npm run start-ci
# Frontend runs on :3000, API on :8080
wait-on: 'http://localhost:3000, http://localhost:8080'
browser: chromium
headed: true

# Records to Cypress Cloud
record: true
Expand Down Expand Up @@ -137,4 +130,3 @@ jobs:
labels: ${{ steps.meta.outputs.labels }}
build-args: |
VITE_VERSION=${{ github.ref_name }}
GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}
1 change: 0 additions & 1 deletion .npmrc

This file was deleted.

3 changes: 1 addition & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ Contributions are welcome. Please note the [Code of Conduct](CODE_OF_CONDUCT.md)
You will need to:

- Install [pre-commit](https://pre-commit.com/)
- Set up a GitHub Personal Access Token to read from the GitHub package repository. Follow the steps in https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-npm-registry#authenticating-with-a-personal-access-token.

Once these steps are done, run `make setup` to perform the repository setup.

Expand Down Expand Up @@ -46,7 +45,7 @@ npm run start:test
npm run test

# If you want to see your browser go wrooom and inspect the tests in detail, use this.
# Note that you'll need to select Chrome or Chromium as browser since neither Electron nor Firefox support Month pickers as of now
# Note that you'll need to select Electron
npm run test:watch

# To run only a specific test, use
Expand Down
4 changes: 1 addition & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ WORKDIR /app
COPY package.json package-lock.json /app/
COPY patches /app/patches

ARG GITHUB_TOKEN
RUN echo "//npm.pkg.github.com/:_authToken=${GITHUB_TOKEN}" >> ~/.npmrc && \
npm install --production
RUN npm install --production

# Copy app files
COPY src /app/src
Expand Down
22 changes: 13 additions & 9 deletions cypress/e2e/dashboard.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,28 +50,31 @@ describe('Dashboard', () => {
})
})

const date = new Date()
const currentMonth = `${date.getFullYear()}-${
date.getMonth() < 9 ? '0' : ''
}${date.getMonth() + 1}`
// Get the current month in YYYY-MM-01 format
const currentMonth = `${new Date(Date.now())
.toISOString()
.substring(0, 7)}-01`

it('can switch between the months', () => {
cy.getByTitle('Select Month').first().click()
cy.get('#month').should('have.value', currentMonth)

cy.visit('#', { qs: { month: '2020-02' } })
cy.get('#month').should('have.value', '2020-02')
cy.contains('February 2020')
cy.contains('Mar')

cy.contains('Jan').click()
cy.contains('Dec').click()

cy.get('#month').should('have.value', '2019-12')
cy.contains('December 2019')
cy.url().should('include', '?month=2019-12')

cy.get('#month').click()
cy.get('input#month').type('2022-03')
cy.getByTitle('Select Month').first().click()

cy.get('input#month').type('2022-03-01')
cy.getByTitle('March 2022').first().click()
cy.awaitLoading()
cy.get('#month').should('have.value', '2022-03')
cy.contains('March 2022')
cy.contains('Feb')
cy.contains('Apr')
})
Expand Down Expand Up @@ -216,6 +219,7 @@ describe('Dashboard', () => {
})

it('can quickly allocate funds to all envelopes', () => {
cy.getByTitle('Select Month').first().click()
cy.get('#month').should('have.value', currentMonth)
cy.visit('#', { qs: { month: '2023-04' } })
cy.awaitLoading()
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/transaction-import.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ describe('Transaction Import', () => {

// Now at the last transaction, import this too
cy.contains('5 of 5')
cy.getInputFor('Available From').should('have.value', '2023-06')
cy.getInputFor('Available From').should('have.value', '2023-06-01')
cy.get('button').contains('Import').click()

// Now back at the second transactions since we skipped it
Expand Down
8 changes: 5 additions & 3 deletions cypress/e2e/transactions.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ import { dateFromIsoString } from '../../src/lib/dates'

describe('Transactions', () => {
const date = new Date()
const currentMonth = `${date.getFullYear()}-${
date.getMonth() < 9 ? '0' : ''
}${date.getMonth() + 1}`

// Get the current month in YYYY-MM-01 format
const currentMonth = `${new Date(Date.now())
.toISOString()
.substring(0, 7)}-01`

beforeEach(() => {
// prepare a budget with two internal & one external accounts
Expand Down
2 changes: 1 addition & 1 deletion docker-compose-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ volumes:

services:
backend:
image: ghcr.io/envelope-zero/backend:v5.1.0
image: ghcr.io/envelope-zero/backend:v5.1.3
user: root
volumes:
- ez-dev-data:/data
Expand Down
2 changes: 1 addition & 1 deletion docker-compose-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ volumes:

services:
backend:
image: ghcr.io/envelope-zero/backend:v5.1.0
image: ghcr.io/envelope-zero/backend:v5.1.3
user: root
volumes:
- ez-production-data:/data
Expand Down
2 changes: 1 addition & 1 deletion docker-compose-test.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '3'
services:
backend:
image: ghcr.io/envelope-zero/backend:v5.1.0
image: ghcr.io/envelope-zero/backend:v5.1.3
user: root
ports:
- 8081:8080
Expand Down
33 changes: 16 additions & 17 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "envelope-zero-frontend",
"dependencies": {
"@envelope-zero/ynap-parsers": "1.17.1",
"@envelope-zero/ynap-parsers": "1.17.3",
"@headlessui/react": "1.7.18",
"@heroicons/react": "2.1.1",
"@tailwindcss/forms": "0.5.7",
Expand Down Expand Up @@ -67,7 +67,7 @@
"server:dev": "docker-compose --project-name frontend-dev --file docker-compose-dev.yml up",
"server:test": "docker-compose --project-name frontend-test --file docker-compose-test.yml up",
"server:production": "docker-compose --project-name frontend-production --file docker-compose-production.yml up --build",
"test": "cypress run --browser chromium",
"test": "cypress run",
"test:watch": "cypress open",
"format": "prettier --write .",
"postinstall": "patch-package"
Expand Down