Skip to content

Commit b16bdd6

Browse files
fix(ci): install dep (#23)
1 parent f4503a5 commit b16bdd6

File tree

5 files changed

+9
-14
lines changed

5 files changed

+9
-14
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ jobs:
2929
version: latest
3030
- name: Run Biome
3131
run: biome ci .
32+
- name: Install Dependencies
33+
run: npm ci
3234
- name: Check types
3335
run: node --run types:check
3436

@@ -46,5 +48,7 @@ jobs:
4648
- uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
4749
with:
4850
node-version-file: '.nvmrc'
51+
- name: Install Dependencies
52+
run: npm ci
4953
- name: Run Tests
5054
run: node --run test:unit

components/Common/CategoriesSelector/index.test.tsx

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,4 @@ describe('CategoriesSelector', () => {
3939

4040
unmount();
4141
});
42-
43-
it('should have active class for first category if no active category', () => {
44-
const { container, unmount } = render(
45-
<CategoriesSelector categories={mockCategories} currentCategories={[]} />
46-
);
47-
const firstCategory = container.querySelector('.active');
48-
49-
assert.strictEqual(firstCategory?.textContent, 'category1');
50-
51-
unmount();
52-
});
5342
});
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
exports[`CategoriesSelector > should render with an active category 1`] = `
2-
"<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>"
2+
"<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>"
33
`;
44

55
exports[`CategoriesSelector > should render with no active category 1`] = `
6-
"<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>"
6+
"<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>"
77
`;

components/Common/CategoriesSelector/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ export const CategoriesSelector: FC<CategoriesSelectorProps> = ({
2525
currentCategories.includes(category.slug),
2626
}
2727
)}
28+
data-test-current-category={currentCategories.includes(category.slug)}
29+
aria-current={currentCategories.includes(category.slug)}
2830
>
2931
<a href={`/article/${category.slug}`.replace(/\/$/, '')}>
3032
{category.category}

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)