Skip to content

Commit

Permalink
Merge pull request #112 from arnellebalane/feature/todo-date
Browse files Browse the repository at this point in the history
Implement optional date field for todo items
  • Loading branch information
arnellebalane authored Oct 27, 2024
2 parents 0b440b4 + 793e00a commit 70b58ca
Show file tree
Hide file tree
Showing 26 changed files with 1,437 additions and 114 deletions.
19 changes: 17 additions & 2 deletions .prettierrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,23 @@
"singleQuote": true,
"printWidth": 120,
"bracketSameLine": false,
"plugins": ["prettier-plugin-svelte"],

"plugins": [
"prettier-plugin-svelte",
"@ianvs/prettier-plugin-sort-imports"
],
"importOrder": [
"<BUILTIN _MODULES>",
"<THIRD_PARTY_MODULES>",
"",
"^(@components|.*/components/.*)",
"",
"^@(?!components)",
"^[.]{2}",
"",
"^[.]",
"",
".css$"
],
"overrides": [
{
"files": "*.svelte",
Expand Down
14 changes: 8 additions & 6 deletions cypress/integration/tags.spec.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
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 { STORAGE_KEY_DATA, STORAGE_KEY_TAGS } from '../lib/constants';
Expand All @@ -23,6 +24,7 @@ describe('tags', () => {
it('can add tags when adding a new todo', () => {
cy.get('[data-cy="add-todo-btn"]').click();
cy.get('[data-cy="todo-form-body"]').type(body);
cy.get('[data-cy="todo-form-optional-fields"]').click();

cy.get('[data-cy="tags-input"]').type(tagOne).focus().trigger('keydown', { code: 'Enter' });
cy.get('[data-cy="tags-input"]').type(tagTwo).focus().trigger('keydown', { code: 'Enter' });
Expand All @@ -34,8 +36,8 @@ describe('tags', () => {
.eq(0)
.within(() => {
cy.get('[data-cy="todo-item-tag"]').should('have.length', 2);
cy.get('[data-cy="todo-item-tag"]').eq(0).should('have.text', tagOne);
cy.get('[data-cy="todo-item-tag"]').eq(1).should('have.text', tagThree);
cy.get('[data-cy="todo-item-tag"]').eq(0).should('contains.text', tagOne);
cy.get('[data-cy="todo-item-tag"]').eq(1).should('contains.text', tagThree);
});
});

Expand All @@ -52,8 +54,8 @@ describe('tags', () => {
.eq(0)
.within(() => {
cy.get('[data-cy="todo-item-tag"]').should('have.length', 2);
cy.get('[data-cy="todo-item-tag"]').eq(0).should('have.text', tagOne);
cy.get('[data-cy="todo-item-tag"]').eq(1).should('have.text', tagThree);
cy.get('[data-cy="todo-item-tag"]').eq(0).should('contains.text', tagOne);
cy.get('[data-cy="todo-item-tag"]').eq(1).should('contains.text', tagThree);
});
});
});
Expand Down Expand Up @@ -95,7 +97,7 @@ describe('tags', () => {

cy.get('[data-cy="todo-item"]').each((element) => {
cy.wrap(element).within(() => {
cy.get('[data-cy="todo-item-tag"]').should('have.length', 1).eq(0).should('have.text', tagTwo);
cy.get('[data-cy="todo-item-tag"]').should('have.length', 1).eq(0).should('contains.text', tagTwo);
});
});
});
Expand Down
Loading

0 comments on commit 70b58ca

Please sign in to comment.