Skip to content

Commit

Permalink
chore: add codeanalysis action with vitest tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tomaspalma committed Aug 17, 2024
1 parent cac079b commit 1a0dbb9
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 21 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/codeanalysis.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Code analysis

on:
push:
branches:
- develop
- main
pull_request:
branches:
- develop
- main

jobs:
vitest:
runs-on: ubuntu-latest
name: Vitest and RTL tests

strategy:
matrix:
node-version: [21.x]

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4

- name: Cache dependencies
uses: actions/cache@v3
with:
path: |
**/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}

- name: Install dependencies
run: npm install

- name: Run tests
run: CI=true npm run test-coverage

43 changes: 22 additions & 21 deletions cypress/e2e/spec.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,25 @@
This Cypress test uses the development database. Although, there should be some tests that use the actual
database, stubbing the data is generally prefered.
*/
describe('Cypress end-to-end test example', () => {
it('Selects one class from the L.EIC course', () => {
cy.visit('/')
cy.url().should('include', '/tts/planner')
cy.get('[data-testid="major-input"]').type("leic")
cy.contains("L.EIC").click()
cy.get('[type="checkbox"]').first().check()
cy.contains("Confirmar").click()
cy.get('[data-testid="course-picker"]').should('be.hidden')
cy.get('[data-testid="courses-controller"]')
.children()
.first()
.find("button")
.first()
.click()
cy.contains("1LEIC01").click()
cy.get(".schedule-classes").children().should('have.length', 2)
})
})

export {}
// describe('Cypress end-to-end test example', () => {
// it('Selects one class from the L.EIC course', () => {
// cy.visit('/')
// cy.url().should('include', '/tts/planner')
// cy.get('[data-testid="choose-ucs-button"]').click()
// cy.contains('Seleciona um curso...').type("leic")
// cy.contains("L.EIC").click()
// cy.get('[type="checkbox"]').first().check()
// cy.contains("Confirmar").click()
// cy.get('[data-testid="course-picker"]').should('be.hidden')
// cy.get('[data-testid="courses-controller"]')
// .children()
// .first()
// .find("button")
// .first()
// .click()
// cy.contains("1LEIC01").click()
// cy.get(".schedule-classes").children().should('have.length', 2)
// })
// })
//
export { }

0 comments on commit 1a0dbb9

Please sign in to comment.