This repository was archived by the owner on Aug 2, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +50
-0
lines changed
ui/src/components/Counter/__tests__ Expand file tree Collapse file tree 2 files changed +50
-0
lines changed Original file line number Diff line number Diff line change 1+ import { mount } from "@vue/test-utils" ;
2+ import { Counter } from "../" ;
3+
4+ describe ( "Counter" , ( ) => {
5+ const infoCounter = mount ( Counter , {
6+ propsData : {
7+ type : "info" ,
8+ value : 44 ,
9+ ariaLabel : "Counter"
10+ }
11+ } ) ;
12+ const notCounter = mount ( Counter , {
13+ propsData : {
14+ type : "notification"
15+ }
16+ } ) ;
17+ it ( "renders correctly" , ( ) => {
18+ expect ( infoCounter . element ) . toMatchSnapshot ( ) ;
19+ expect ( notCounter . element ) . toMatchSnapshot ( ) ;
20+ } ) ;
21+ it ( "renders type correctly" , ( ) => {
22+ expect ( infoCounter . classes ( "fd-counter" ) ) . toBe ( true ) ;
23+ expect ( notCounter . classes ( "fd-counter--notification" ) ) . toBe ( true ) ;
24+ } ) ;
25+ it ( "renders value correctly" , ( ) => {
26+ expect ( infoCounter . props ( ) . value ) . toBe ( 44 ) ;
27+ expect ( notCounter . props ( ) . value ) . toBe ( 0 ) ;
28+ } ) ;
29+ it ( "renders ariaLabel correctly" , ( ) => {
30+ expect ( infoCounter . props ( ) . ariaLabel ) . toBe ( "Counter" ) ;
31+ } ) ;
32+ } ) ;
Original file line number Diff line number Diff line change 1+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+ exports [` Counter renders correctly 1` ] = `
4+ <span
5+ arialabel = " Counter"
6+ class = " fd-counter"
7+ >
8+ 44
9+ </span >
10+ ` ;
11+
12+ exports [` Counter renders correctly 2` ] = `
13+ <span
14+ class = " fd-counter fd-counter--notification"
15+ >
16+ 0
17+ </span >
18+ ` ;
You can’t perform that action at this time.
0 commit comments