diff --git a/apps/fluent-tester/src/TestComponents/Avatar/E2EAvatarTest.tsx b/apps/fluent-tester/src/TestComponents/Avatar/E2EAvatarTest.tsx
index 14e001a992..bba9ba21bf 100644
--- a/apps/fluent-tester/src/TestComponents/Avatar/E2EAvatarTest.tsx
+++ b/apps/fluent-tester/src/TestComponents/Avatar/E2EAvatarTest.tsx
@@ -25,6 +25,7 @@ export const E2EAvatarTest: React.FunctionComponent = () => {
diff --git a/change/@fluentui-react-native-avatar-afbabcb7-20be-4858-b26f-36cc256153be.json b/change/@fluentui-react-native-avatar-afbabcb7-20be-4858-b26f-36cc256153be.json
new file mode 100644
index 0000000000..49208d7586
--- /dev/null
+++ b/change/@fluentui-react-native-avatar-afbabcb7-20be-4858-b26f-36cc256153be.json
@@ -0,0 +1,7 @@
+{
+ "type": "patch",
+ "comment": "Fix default avatar rendering and e2e section",
+ "packageName": "@fluentui-react-native/avatar",
+ "email": "ayushsinghs@yahoo.in",
+ "dependentChangeType": "patch"
+}
diff --git a/change/@fluentui-react-native-tester-d73be75c-c520-4e1c-8e88-7d9c1b9fdfc7.json b/change/@fluentui-react-native-tester-d73be75c-c520-4e1c-8e88-7d9c1b9fdfc7.json
new file mode 100644
index 0000000000..45c0f68b2e
--- /dev/null
+++ b/change/@fluentui-react-native-tester-d73be75c-c520-4e1c-8e88-7d9c1b9fdfc7.json
@@ -0,0 +1,7 @@
+{
+ "type": "minor",
+ "comment": "Fix default avatar rendering and e2e section",
+ "packageName": "@fluentui-react-native/tester",
+ "email": "ayushsinghs@yahoo.in",
+ "dependentChangeType": "patch"
+}
diff --git a/packages/components/Avatar/src/AvatarTokens.mobile.ts b/packages/components/Avatar/src/AvatarTokens.mobile.ts
index ab7fa152f9..de208618ca 100644
--- a/packages/components/Avatar/src/AvatarTokens.mobile.ts
+++ b/packages/components/Avatar/src/AvatarTokens.mobile.ts
@@ -6,15 +6,10 @@ import type { AvatarTokens } from '.';
export const defaultAvatarTokens: TokenSettings = (t: Theme) =>
({
- badgeSize: 'small',
color: t.colors.neutralForeground3,
backgroundColor: t.colors.neutralBackground5,
avatarOpacity: 1,
fontFamily: t.typography.variants.body1.face,
- fontWeight: globalTokens.font.weight.semibold,
- fontSize: globalTokens.font.size200,
- size: 56,
- iconSize: 16,
iconColor: t.colors.neutralForeground2,
ringBackgroundColor: t.colors.neutralBackground1,
ringColor: t.colors.neutralStroke1,
@@ -22,6 +17,16 @@ export const defaultAvatarTokens: TokenSettings = (t: Theme
circular: {
borderRadius: globalTokens.corner.radiusCircular,
},
+ size: 24,
+ badgeSize: 'small',
+ badgeY: -1 - globalTokens.stroke.width20, // width20 subtracted to accomodate border width of presence badge
+ badgeX: 1 - globalTokens.stroke.width20, // sign negated to flip x-axis based on design assumption
+ iconSize: 16,
+ fontSize: globalTokens.font.size100,
+ fontWeight: globalTokens.font.weight.regular,
+ square: {
+ borderRadius: globalTokens.corner.radius40,
+ },
// Badge is not shown for size 16 on Android.
size16: {
size: 16,
diff --git a/packages/components/Avatar/src/__tests__/Avatar.test.jsx b/packages/components/Avatar/src/__tests__/Avatar.test.tsx
similarity index 85%
rename from packages/components/Avatar/src/__tests__/Avatar.test.jsx
rename to packages/components/Avatar/src/__tests__/Avatar.test.tsx
index 0f1cc71dd8..494d8d6914 100644
--- a/packages/components/Avatar/src/__tests__/Avatar.test.jsx
+++ b/packages/components/Avatar/src/__tests__/Avatar.test.tsx
@@ -92,13 +92,6 @@ const edgeCaseData = [
['1x1', 'X'],
];
-describe('Avatar rendering', () => {
- it('renders Avatar', () => {
- const tree = renderer.create().toJSON();
- expect(tree).toMatchSnapshot();
- });
-});
-
describe('getInitials method', () => {
it.each(emptyData)("returns an empty string for '%s'", (text, expected) => {
expect(getInitials(text)).toBe(expected);
@@ -140,3 +133,30 @@ describe('resolveColorfulToSpecificColor method', () => {
expect(resolveColorfulToSpecificColor('x', undefined)).toBe('darkRed');
});
});
+
+describe('Avatar component tests', () => {
+ it('Avatar default', () => {
+ const tree = renderer.create().toJSON();
+ expect(tree).toMatchSnapshot();
+ });
+
+ it('Avatar circular', () => {
+ const tree = renderer.create().toJSON();
+ expect(tree).toMatchSnapshot();
+ });
+
+ it('Avatar square', () => {
+ const tree = renderer.create().toJSON();
+ expect(tree).toMatchSnapshot();
+ });
+
+ it('Avatar badge', () => {
+ const tree = renderer.create().toJSON();
+ expect(tree).toMatchSnapshot();
+ });
+
+ it('Avatar ring', () => {
+ const tree = renderer.create().toJSON();
+ expect(tree).toMatchSnapshot();
+ });
+});
diff --git a/packages/components/Avatar/src/__tests__/__snapshots__/Avatar.test.jsx.snap b/packages/components/Avatar/src/__tests__/__snapshots__/Avatar.test.jsx.snap
deleted file mode 100644
index 57aa9ec47d..0000000000
--- a/packages/components/Avatar/src/__tests__/__snapshots__/Avatar.test.jsx.snap
+++ /dev/null
@@ -1,92 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`Avatar rendering renders Avatar 1`] = `
-
-
-
-
-
-
-
-
-
-`;
diff --git a/packages/components/Avatar/src/__tests__/__snapshots__/Avatar.test.tsx.snap b/packages/components/Avatar/src/__tests__/__snapshots__/Avatar.test.tsx.snap
new file mode 100644
index 0000000000..0b22e5cb15
--- /dev/null
+++ b/packages/components/Avatar/src/__tests__/__snapshots__/Avatar.test.tsx.snap
@@ -0,0 +1,560 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`Avatar component tests Avatar badge 1`] = `
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+`;
+
+exports[`Avatar component tests Avatar circular 1`] = `
+
+
+
+
+
+
+
+
+
+`;
+
+exports[`Avatar component tests Avatar default 1`] = `
+
+
+
+
+
+
+
+
+
+`;
+
+exports[`Avatar component tests Avatar ring 1`] = `
+
+
+
+
+
+
+
+
+
+
+
+`;
+
+exports[`Avatar component tests Avatar square 1`] = `
+
+
+
+
+
+
+
+
+
+`;