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

Support optional date field for todo items #112

Merged
merged 14 commits into from
Oct 27, 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
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