Skip to content

Commit

Permalink
Move todos test helper file into test directory
Browse files Browse the repository at this point in the history
  • Loading branch information
arnellebalane committed Nov 24, 2024
1 parent fe39d3c commit 5d3c7b7
Show file tree
Hide file tree
Showing 24 changed files with 368 additions and 77 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy-changes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '18.x'
node-version: 18
- run: npm ci
- run: npm test

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '18.x'
node-version: 18
- run: npm ci
- run: npm test
3 changes: 3 additions & 0 deletions cypress.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
require('dotenv').config();
const { defineConfig } = require('cypress');
const vite = require('cypress-vite');

module.exports = defineConfig({
projectId: 'dkoa9n',
Expand Down Expand Up @@ -28,6 +29,8 @@ module.exports = defineConfig({
throw new Error('APP_TESTING_ENDPOINT variable is not defined.');
}

on('file:preprocessor', vite());

return config;
},
},
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/backgrounds.spec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { BACKGROUND_REFRESH_MANUALLY, BACKGROUND_SOURCE_CUSTOM } from '../../src/features/backgrounds/constants';
import { BACKGROUND_REFRESH_MANUALLY, BACKGROUND_SOURCE_CUSTOM } from '@features/backgrounds/constants';

describe('backgrounds', () => {
const settingsLabel = 'Background';
Expand Down
3 changes: 2 additions & 1 deletion cypress/integration/quicklinks.spec.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { faker } from '@faker-js/faker';
import { STORAGE_KEY_SETTINGS } from '../lib/constants';

import { STORAGE_KEY_SETTINGS } from '@lib/constants';

describe('quicklinks', () => {
const settingsLabel = 'Quick Links';
Expand Down
5 changes: 3 additions & 2 deletions cypress/integration/search.spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { faker } from '@faker-js/faker';
import { TODOS_EVENTUALLY, TODOS_THIS_WEEK, TODOS_TODAY } from '../../src/features/todos/constants';
import { generateTodo } from '../../src/features/todos/utils/test-helpers';

import { TODOS_EVENTUALLY, TODOS_THIS_WEEK, TODOS_TODAY } from '@features/todos/constants';
import { generateTodo } from '@test/helpers';
import { STORAGE_KEY_DATA, STORAGE_KEY_TAGS } from '../lib/constants';

describe('search', () => {
Expand Down
4 changes: 2 additions & 2 deletions cypress/integration/settings.spec.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { generateTodo } from '../../src/features/todos/utils/test-helpers';
import { STORAGE_KEY_DATA } from '../lib/constants';
import { STORAGE_KEY_DATA } from '@lib/constants';
import { generateTodo } from '@test/helpers';

describe('settings', () => {
const settingsLabel = 'Miscellaneous';
Expand Down
11 changes: 7 additions & 4 deletions cypress/integration/tags.spec.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { faker } from '@faker-js/faker';
import orderBy from 'lodash/orderBy';

import { faker } from '@faker-js/faker';
import { TODOS_EVENTUALLY, TODOS_THIS_WEEK, TODOS_TODAY } from '../../src/features/todos/constants';
import { generateTodo } from '../../src/features/todos/utils/test-helpers';
import { TODOS_EVENTUALLY, TODOS_THIS_WEEK, TODOS_TODAY } from '@features/todos/constants';
import { generateTodo } from '@test/helpers';
import { STORAGE_KEY_DATA, STORAGE_KEY_TAGS } from '../lib/constants';

describe('tags', () => {
Expand Down Expand Up @@ -97,7 +97,10 @@ describe('tags', () => {

cy.get('[data-testid="todo-item"]').each((element) => {
cy.wrap(element).within(() => {
cy.get('[data-testid="todo-item-tag"]').should('have.length', 1).eq(0).should('contains.text', tagTwo);
cy.get('[data-testid="todo-item-tag"]')
.should('have.length', 1)
.eq(0)
.should('contains.text', tagTwo);
});
});
});
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/themes.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
THEME_DARK,
THEME_LIGHT,
THEME_SYSTEM,
} from '../../src/features/themes/constants';
} from '@features/themes/constants';

describe('themes', () => {
const settingsLabel = 'Theme';
Expand Down
7 changes: 4 additions & 3 deletions cypress/integration/todos.spec.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { faker } from '@faker-js/faker';
import { TODOS_EVENTUALLY, TODOS_THIS_WEEK, TODOS_TODAY } from '../../src/features/todos/constants';
import { generateTodo } from '../../src/features/todos/utils/test-helpers';
import { SHORT_DELAY, STORAGE_KEY_DATA } from '../lib/constants';

import { TODOS_EVENTUALLY, TODOS_THIS_WEEK, TODOS_TODAY } from '@features/todos/constants';
import { generateTodo } from '@test/helpers';
import { STORAGE_KEY_DATA } from '../lib/constants';

describe('todos', () => {
const body = faker.string.alpha(10);
Expand Down
21 changes: 0 additions & 21 deletions cypress/support/component-index.html

This file was deleted.

29 changes: 0 additions & 29 deletions cypress/support/component.js

This file was deleted.

Loading

0 comments on commit 5d3c7b7

Please sign in to comment.