Skip to content

fix(ci): install dep #23

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

Merged
merged 3 commits into from
Feb 16, 2025
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
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ jobs:
version: latest
- name: Run Biome
run: biome ci .
- name: Install Dependencies
run: npm ci
- name: Check types
run: node --run types:check

Expand All @@ -46,5 +48,7 @@ jobs:
- uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
with:
node-version-file: '.nvmrc'
- name: Install Dependencies
run: npm ci
- name: Run Tests
run: node --run test:unit
11 changes: 0 additions & 11 deletions components/Common/CategoriesSelector/index.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,4 @@ describe('CategoriesSelector', () => {

unmount();
});

it('should have active class for first category if no active category', () => {
const { container, unmount } = render(
<CategoriesSelector categories={mockCategories} currentCategories={[]} />
);
const firstCategory = container.querySelector('.active');

assert.strictEqual(firstCategory?.textContent, 'category1');

unmount();
});
});
4 changes: 2 additions & 2 deletions components/Common/CategoriesSelector/index.test.tsx.snapshot
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
exports[`CategoriesSelector > should render with an active category 1`] = `
"<ul class=\\"categoriesSelector\\"><li class=\\"item active\\"><a href=\\"/article/slug1\\">category1</a></li><li class=\\"item\\"><a href=\\"/article/slug2\\">category2</a></li></ul>"
"<ul class=\\"mb-4 flex space-x-2 border-green-400 border-b-4 text-gray-800 dark:border-green-600 dark:text-gray-200\\"><li class=\\"flex cursor-pointer items-center rounded-t-md px-2 py-1 transition duration-200 hover:bg-green-400 hover:text-white dark:hover:bg-green-600 dark:hover:text-white bg-green-400 text-white dark:bg-green-600\\" data-test-current-category=\\"true\\" aria-current=\\"true\\"><a href=\\"/article/slug1\\">category1</a></li><li class=\\"flex cursor-pointer items-center rounded-t-md px-2 py-1 transition duration-200 hover:bg-green-400 hover:text-white dark:hover:bg-green-600 dark:hover:text-white\\" data-test-current-category=\\"false\\" aria-current=\\"false\\"><a href=\\"/article/slug2\\">category2</a></li></ul>"
`;

exports[`CategoriesSelector > should render with no active category 1`] = `
"<ul class=\\"categoriesSelector\\"><li class=\\"item active\\"><a href=\\"/article/slug1\\">category1</a></li><li class=\\"item\\"><a href=\\"/article/slug2\\">category2</a></li></ul>"
"<ul class=\\"mb-4 flex space-x-2 border-green-400 border-b-4 text-gray-800 dark:border-green-600 dark:text-gray-200\\"><li class=\\"flex cursor-pointer items-center rounded-t-md px-2 py-1 transition duration-200 hover:bg-green-400 hover:text-white dark:hover:bg-green-600 dark:hover:text-white bg-green-400 text-white dark:bg-green-600\\" data-test-current-category=\\"false\\" aria-current=\\"false\\"><a href=\\"/article/slug1\\">category1</a></li><li class=\\"flex cursor-pointer items-center rounded-t-md px-2 py-1 transition duration-200 hover:bg-green-400 hover:text-white dark:hover:bg-green-600 dark:hover:text-white\\" data-test-current-category=\\"false\\" aria-current=\\"false\\"><a href=\\"/article/slug2\\">category2</a></li></ul>"
`;
2 changes: 2 additions & 0 deletions components/Common/CategoriesSelector/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ export const CategoriesSelector: FC<CategoriesSelectorProps> = ({
currentCategories.includes(category.slug),
}
)}
data-test-current-category={currentCategories.includes(category.slug)}
aria-current={currentCategories.includes(category.slug)}
>
<a href={`/article/${category.slug}`.replace(/\/$/, '')}>
{category.category}
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.