Skip to content

Commit

Permalink
fix unit test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
prabhuignoto committed Jun 11, 2023
1 parent 3af4246 commit 0da6ba3
Show file tree
Hide file tree
Showing 16 changed files with 190 additions and 94 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
"@types/react-dom": "^18.2.4",
"@typescript-eslint/eslint-plugin": "^5.59.9",
"@typescript-eslint/parser": "^5.59.9",
"@vitest/coverage-c8": "^0.32.0",
"autoprefixer": "^10.4.14",
"cssnano": "^6.0.1",
"esbuild": "^0.18.0",
Expand Down Expand Up @@ -113,6 +112,7 @@
},
"packageManager": "[email protected]",
"devDependencies": {
"@vitest/coverage-v8": "^0.32.0",
"postcss-scss": "^4.0.6"
}
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
// Vitest Snapshot v1
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`Accordion > should render snapshot 1`] = `
<div
class="_accordion_f93c7f _no-border_f93c7f"
>
<div
aria-controls="accordion-body-VFiTSWFT0kSHZOLAV5_eb"
aria-controls="accordion-body-XfRrlOZr-kAK81oCjc2g4"
aria-expanded="false"
class="_header_c2ceb5 _focusable_c2ceb5 _size_c2ceb5"
id="accordion-XcPx70POxnDL77uUma9OY"
id="accordion-arH2_AXQ4MB5xQEXQYl78"
role="button"
style="--rc-accordion-header-height: 40px; outline: none; position: relative;"
tabindex="0"
Expand Down Expand Up @@ -40,9 +40,9 @@ exports[`Accordion > should render snapshot 1`] = `
/>
</div>
<div
aria-labelledby="accordion-XcPx70POxnDL77uUma9OY"
aria-labelledby="accordion-arH2_AXQ4MB5xQEXQYl78"
class="_body_f93c7f _animate_f93c7f _close_f93c7f"
id="accordion-body-VFiTSWFT0kSHZOLAV5_eb"
id="accordion-body-XfRrlOZr-kAK81oCjc2g4"
style="--title-color: #000; --transition: cubic-bezier(0.19, 1, 0.22, 1); --max-height: 0px;"
>
<div
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Vitest Snapshot v1
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`Avatar > should render avatar with default props 1`] = `
<div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Vitest Snapshot v1
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`Breadcrumb > should render snapshot 1`] = `
<ul
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Vitest Snapshot v1
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`Button > should render button snapshot 1`] = `
<div
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Vitest Snapshot v1
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`Carousel Button > should render carousel button snapshot 1`] = `
<div
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Vitest Snapshot v1
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`Carousel items > Should render carousel items snapshot 1`] = `
<ul
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Vitest Snapshot v1
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`Carousel Track > Should render the track snapshot 1`] = `
<ul
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Vitest Snapshot v1
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`Carousel > should render carousel snapshot 1`] = `
<div
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Vitest Snapshot v1
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`CheckboxGroup > should match snapshot 1`] = `
<div>
Expand Down
13 changes: 10 additions & 3 deletions packages/lib/components/gallery/__tests__/gallery.test.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { render } from '@testing-library/react';
import { Image } from 'react-creme';

import { Image } from '../../image/image';
import { Gallery } from '../gallery';

describe('Gallery', () => {
Expand All @@ -23,6 +22,14 @@ describe('Gallery', () => {
src="https://mmc.tirto.id/image/otf/500x0/2016/07/26/TIRTO-20140522_batman_warner-bros_ratio-16x9.jpg"
alt="test_image_4"
/>
<Image
src="https://mmc.tirto.id/image/otf/500x0/2016/07/26/TIRTO-20140522_batman_warner-bros_ratio-16x9.jpg"
alt="test_image_5"
/>
<Image
src="https://mmc.tirto.id/image/otf/500x0/2016/07/26/TIRTO-20140522_batman_warner-bros_ratio-16x9.jpg"
alt="test_image_5"
/>
</Gallery>
);
expect(getByAltText('test_image_1')).toBeInTheDocument();
Expand All @@ -35,7 +42,7 @@ describe('Gallery', () => {

expect(
(container.firstChild as HTMLElement).querySelectorAll('img')
).toHaveLength(4);
).toHaveLength(6);
});

it("should render all the imageURL's", () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Vitest Snapshot v1
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`Section > should render Section correctly 1`] = `
<div
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
// Vitest Snapshot v1
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`Tabs > should render snapshot 1`] = `
<div
class="_tab_headers_43d7a7 _flat_43d7a7"
role="tablist"
>
<div
aria-controls="rc-tab-panel-Djueinh5LaxYyAcTwEfqY"
aria-controls="rc-tab-panel-ICLcMV2nxy4U-Z5-zTeHg"
aria-selected="true"
class="_tab_head_43d7a7 _tab_head_selected_43d7a7 _tab_head_flat_43d7a7 _tab_head_sm_43d7a7"
id="rc-tab-Djueinh5LaxYyAcTwEfqY"
id="rc-tab-ICLcMV2nxy4U-Z5-zTeHg"
role="tab"
style="outline: none; position: relative;"
tabindex="0"
Expand All @@ -25,10 +25,10 @@ exports[`Tabs > should render snapshot 1`] = `
/>
</div>
<div
aria-controls="rc-tab-panel-VdfGn4mP7ev8M-Z1qMSgC"
aria-controls="rc-tab-panel-tX_JkUtuqzFJxLsvGI6sC"
aria-selected="false"
class="_tab_head_43d7a7 _tab_head_flat_43d7a7 _tab_head_sm_43d7a7"
id="rc-tab-VdfGn4mP7ev8M-Z1qMSgC"
id="rc-tab-tX_JkUtuqzFJxLsvGI6sC"
role="tab"
style="outline: none; position: relative;"
tabindex="-1"
Expand All @@ -44,10 +44,10 @@ exports[`Tabs > should render snapshot 1`] = `
/>
</div>
<div
aria-controls="rc-tab-panel-Z3qPr4OqVyUEbY-Q0cSCw"
aria-controls="rc-tab-panel-FfPzjyeHz09hmWbs5kFXY"
aria-selected="false"
class="_tab_head_43d7a7 _tab_head_flat_43d7a7 _tab_head_sm_43d7a7"
id="rc-tab-Z3qPr4OqVyUEbY-Q0cSCw"
id="rc-tab-FfPzjyeHz09hmWbs5kFXY"
role="tab"
style="outline: none; position: relative;"
tabindex="-1"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Vitest Snapshot v1
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`Transfer > should render transfer snapshot 1`] = `
<div
Expand Down
1 change: 0 additions & 1 deletion packages/lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@
"@vitest/ui": "^0.32.0",
"autoprefixer": "^10.4.14",
"babel-loader": "^9.1.2",
"c8": "^7.14.0",
"copy-webpack-plugin": "^11.0.0",
"css-loader": "6.7.1",
"eslint-plugin-jsx-a11y": "^6.7.1",
Expand Down
Loading

1 comment on commit 0da6ba3

@vercel
Copy link

@vercel vercel bot commented on 0da6ba3 Jun 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.