File tree Expand file tree Collapse file tree 3 files changed +42
-4
lines changed Expand file tree Collapse file tree 3 files changed +42
-4
lines changed Original file line number Diff line number Diff line change 1
1
import { expect , it , describe } from 'vitest'
2
- import { render , screen } from '@testing-library/react'
2
+ import { render } from '@testing-library/react'
3
3
import Loading from '../../src/app/loading'
4
4
5
5
describe ( 'Loading' , ( ) => {
@@ -8,7 +8,7 @@ describe('Loading', () => {
8
8
expect ( component ) . toBeDefined ( )
9
9
} )
10
10
it ( 'should display loading label' , ( ) => {
11
- render ( < Loading /> )
12
- expect ( screen . getByText ( 'Loading...' ) ) . toBeTruthy ( )
11
+ const { container } = render ( < Loading /> )
12
+ expect ( container . getElementsByClassName ( 'loader' ) . length ) . toBe ( 1 )
13
13
} )
14
14
} )
Original file line number Diff line number Diff line change 1
1
export default function Loading ( ) {
2
2
// You can add any UI inside Loading, including a Skeleton.
3
- return < div > Loading...</ div >
3
+ return (
4
+ < div className = 'w-full h-[90vh] flex items-center justify-center' >
5
+ < span className = 'loader' > </ span >
6
+ </ div >
7
+ )
4
8
}
Original file line number Diff line number Diff line change 1
1
@tailwind base;
2
2
@tailwind components;
3
3
@tailwind utilities;
4
+
5
+ .loader {
6
+ width : 48px ;
7
+ height : 48px ;
8
+ border : 3px solid # 1a1a1a ;
9
+ border-radius : 50% ;
10
+ display : inline-block;
11
+ position : relative;
12
+ box-sizing : border-box;
13
+ animation : rotation 1s linear infinite;
14
+ }
15
+
16
+ .loader ::after {
17
+ content : '' ;
18
+ box-sizing : border-box;
19
+ position : absolute;
20
+ left : 50% ;
21
+ top : 50% ;
22
+ transform : translate (-50% , -50% );
23
+ width : 40px ;
24
+ height : 40px ;
25
+ border-radius : 50% ;
26
+ border : 3px solid;
27
+ border-color : # 1a1a1a transparent;
28
+ }
29
+
30
+ @keyframes rotation {
31
+ 0% {
32
+ transform : rotate (0deg );
33
+ }
34
+ 100% {
35
+ transform : rotate (360deg );
36
+ }
37
+ }
You can’t perform that action at this time.
0 commit comments