-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: move AltinnContentLoader (#13932)
- Loading branch information
Showing
7 changed files
with
35 additions
and
27 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
...velopment/features/appPublish/components/AltinnContentLoader/AltinnContentLoader.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import React from 'react'; | ||
import { render, screen } from '@testing-library/react'; | ||
import { AltinnContentLoader } from './AltinnContentLoader'; | ||
|
||
describe('AltinnContentLoader', () => { | ||
it('should render with default height and width', () => { | ||
render(<AltinnContentLoader />); | ||
|
||
const loader = screen.getByRole('img', { hidden: true }); | ||
expect(loader).toHaveAttribute('height', '200'); | ||
expect(loader).toHaveAttribute('width', '400'); | ||
}); | ||
|
||
it('should render with custom height and width', () => { | ||
render(<AltinnContentLoader height={300} width={500} />); | ||
|
||
const loader = screen.getByRole('img', { hidden: true }); | ||
expect(loader).toHaveAttribute('height', '300'); | ||
expect(loader).toHaveAttribute('width', '500'); | ||
}); | ||
|
||
it('should render children', () => { | ||
render( | ||
<AltinnContentLoader> | ||
<rect x='0' y='0' width='100' height='100' /> | ||
</AltinnContentLoader>, | ||
); | ||
expect(screen.getByRole('img')).toBeInTheDocument(); | ||
}); | ||
}); |
12 changes: 2 additions & 10 deletions
12
...ponents/molecules/AltinnContentLoader.tsx → ...tinnContentLoader/AltinnContentLoader.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
frontend/app-development/features/appPublish/components/AltinnContentLoader/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { AltinnContentLoader } from './AltinnContentLoader'; |
2 changes: 1 addition & 1 deletion
2
frontend/app-development/features/appPublish/containers/DeploymentContainer.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 0 additions & 11 deletions
11
frontend/packages/shared/src/components/molecules/AltinnContentLoader.md
This file was deleted.
Oops, something went wrong.
4 changes: 0 additions & 4 deletions
4
frontend/packages/shared/src/components/molecules/AltinnPopoverSimple.module.css
This file was deleted.
Oops, something went wrong.