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

Minor fixes #51

Merged
merged 6 commits into from
Jun 14, 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
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20.13.1
node-version: 20.14
- name: Install dependencies
run: npm ci
- run: npm run build
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20.13.1
node-version: 20.14
- run: npm ci
- run: npm run lint

Expand All @@ -23,7 +23,7 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20.13.1
node-version: 20.14
- run: npm ci
- run: npm run test:unit

Expand All @@ -35,7 +35,7 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20.13.1
node-version: 20.14
- run: npm ci
- name: Cypress install
uses: cypress-io/github-action@v6
Expand Down
74 changes: 37 additions & 37 deletions cypress/e2e/schedule.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ describe('Schedule tests', () => {
cy.getByTestId('week-0-day-1').find('.training-card').should('exist');
cy.getByTestId('week-0-copy-button').click();
cy.getByTestId('schedule').find('.v-expansion-panel').should('have.length', 2);
cy.getByTestId('week-0-day-1').find('.training-card__action-button').click();
cy.get('.training-card__delete-button').click();
cy.get('.training-card-actions__action-button:visible').click();
cy.getByTestId('training-card-actions-delete-button').click();
cy.getByTestId('week-0-day-1').find('.training-card').should('not.exist');
cy.getByTestId('week-1').click();
cy.getByTestId('week-1-calendar-tab-1').click();
Expand All @@ -25,22 +25,22 @@ describe('Schedule tests', () => {

it('copies and moves trainings', () => {
cy.addTraining();
cy.get('.training-card__action-button').click();
cy.get('.training-card-actions__copy').contains('Copy').click();
cy.get('.training-card-actions__copy').contains('Week 1').click();
cy.get('.training-card-actions__copy').contains('Tuesday').click();
cy.get('.training-card-actions__move').contains('Move').click();
cy.get('.training-card-actions__move').contains('Week 1').click();
cy.get('.training-card-actions__move').contains('Wednesday').click();
cy.get('.training-card-actions__action-button').click();
cy.getByTestId('training-card-actions-copy-button').click();
cy.getByTestId('training-card-actions-copy-menu').contains('Week 1').click();
cy.getByTestId('training-card-actions-copy-menu').contains('Tuesday').click();
cy.getByTestId('training-card-actions-move-button').click();
cy.getByTestId('training-card-actions-move-menu').contains('Week 1').click();
cy.getByTestId('training-card-actions-move-menu').contains('Wednesday').click();
cy.get('.training-card').should('not.exist');
cy.getByTestId('week-0-calendar-tab-1').click();
cy.get('.training-card').should('exist');
cy.getByTestId('week-0-calendar-tab-2').click();
cy.get('.training-card').should('exist');
cy.get('.training-card__action-button:visible').click();
cy.get('.training-card-actions__copy').contains('Copy').click();
cy.get('.training-card-actions__copy').contains('New Week').click();
cy.get('.training-card-actions__copy .v-list-item:visible').contains('Monday').click();
cy.get('.training-card-actions__action-button:visible').click();
cy.getByTestId('training-card-actions-copy-button').click();
cy.getByTestId('training-card-actions-copy-menu').contains('New Week').click();
cy.getByTestId('training-card-actions-copy-menu').find('.v-list-item:visible').contains('Monday').click();
cy.getByTestId('week-1').should('exist');
cy.getByTestId('schedule').contains('Week 2').click({force: true});
cy.getByTestId('week-1-calendar-tab-0').click();
Expand All @@ -62,34 +62,34 @@ describe('Schedule tests', () => {

it('completes and rates trainings', () => {
cy.addTraining();
cy.get('.training-card__action-button').click();
cy.get('.training-card__complete-button').click();
cy.get('.training-card__rating .v-selection-control:nth-child(1)').should('not.have.class', 'training-card__filled-star');
cy.get('.training-card__rating .v-selection-control:nth-child(2)').should('not.have.class', 'training-card__filled-star');
cy.get('.training-card__rating .v-selection-control:nth-child(3)').should('not.have.class', 'training-card__filled-star');
cy.get('.training-card__rating .v-selection-control:nth-child(4)').should('not.have.class', 'training-card__filled-star');
cy.get('.training-card__rating .v-selection-control:nth-child(5)').should('not.have.class', 'training-card__filled-star');
cy.get('.training-card__rating input').eq(0).click();
cy.get('.training-card__rating .v-selection-control:nth-child(1)').should('have.class', 'training-card__filled-star');
cy.get('.training-card__rating input').eq(1).click();
cy.get('.training-card__rating .v-selection-control:nth-child(2)').should('have.class', 'training-card__filled-star');
cy.get('.training-card__rating input').eq(2).click();
cy.get('.training-card__rating .v-selection-control:nth-child(3)').should('have.class', 'training-card__filled-star');
cy.get('.training-card__rating input').eq(3).click();
cy.get('.training-card__rating .v-selection-control:nth-child(4)').should('have.class', 'training-card__filled-star');
cy.get('.training-card__rating input').eq(4).click();
cy.get('.training-card__rating .v-selection-control:nth-child(5)').should('have.class', 'training-card__filled-star');
cy.get('.training-card__rating input').eq(4).click();
cy.get('.training-card__rating .v-selection-control:nth-child(1)').should('not.have.class', 'training-card__filled-star');
cy.get('.training-card__rating .v-selection-control:nth-child(2)').should('not.have.class', 'training-card__filled-star');
cy.get('.training-card__rating .v-selection-control:nth-child(3)').should('not.have.class', 'training-card__filled-star');
cy.get('.training-card__rating .v-selection-control:nth-child(4)').should('not.have.class', 'training-card__filled-star');
cy.get('.training-card__rating .v-selection-control:nth-child(5)').should('not.have.class', 'training-card__filled-star');
cy.get('.training-card-actions__action-button').click();
cy.getByTestId('training-card-actions-complete-button').click();
cy.get('.training-card-rating__star--1').should('not.have.class', 'training-card-rating__star--filled');
cy.get('.training-card-rating__star--2').should('not.have.class', 'training-card-rating__star--filled');
cy.get('.training-card-rating__star--3').should('not.have.class', 'training-card-rating__star--filled');
cy.get('.training-card-rating__star--4').should('not.have.class', 'training-card-rating__star--filled');
cy.get('.training-card-rating__star--5').should('not.have.class', 'training-card-rating__star--filled');
cy.get('.training-card-rating__star--1').click();
cy.get('.training-card-rating__star--1').should('have.class', 'training-card-rating__star--filled');
cy.get('.training-card-rating__star--2').click();
cy.get('.training-card-rating__star--2').should('have.class', 'training-card-rating__star--filled');
cy.get('.training-card-rating__star--3').click();
cy.get('.training-card-rating__star--3').should('have.class', 'training-card-rating__star--filled');
cy.get('.training-card-rating__star--4').click();
cy.get('.training-card-rating__star--4').should('have.class', 'training-card-rating__star--filled');
cy.get('.training-card-rating__star--5').click();
cy.get('.training-card-rating__star--5').should('have.class', 'training-card-rating__star--filled');
cy.get('.training-card-rating__star--5').click();
cy.get('.training-card-rating__star--1').should('not.have.class', 'training-card-rating__star--filled');
cy.get('.training-card-rating__star--2').should('not.have.class', 'training-card-rating__star--filled');
cy.get('.training-card-rating__star--3').should('not.have.class', 'training-card-rating__star--filled');
cy.get('.training-card-rating__star--4').should('not.have.class', 'training-card-rating__star--filled');
cy.get('.training-card-rating__star--5').should('not.have.class', 'training-card-rating__star--filled');
});

it('displays instructions', () => {
cy.addTraining();
cy.get('.training-card__more-button').click();
cy.get('.training-card-actions__more-button').click();
cy.get('.training-card__instructions').should('have.text', 'Take it easy');
cy.get('.training-card__close-instructions-button').click();
cy.get('.training-card__instructions').should('not.exist');
Expand Down
4 changes: 2 additions & 2 deletions cypress/support/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ Cypress.Commands.add('addTraining', (addWeek = true) => {
}
cy.getByTestId('week-0-add-training-button').click();
cy.getByTestId('edit-training-activity').click();
cy.get('.v-list-item').first().click();
cy.getByTestId('edit-training-activity-badminton').click();
cy.getByTestId('edit-training-title')
.type('My training')
.getByTestId('edit-training-location')
.type('Gym')
.type('Sport hall')
.getByTestId('edit-training-duration')
.find('input')
.type('.5')
Expand Down
Loading