Skip to content

Commit

Permalink
fix test and updated snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
Rajat-Dabade committed Jan 10, 2025
1 parent c3b6f00 commit 6dfa62c
Show file tree
Hide file tree
Showing 11 changed files with 628 additions and 23 deletions.
8 changes: 4 additions & 4 deletions app/components/draft/__snapshots__/draft.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ exports[`Draft should match the file count 1`] = `
}
}
accessible={true}
focusable={false}
focusable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
Expand Down Expand Up @@ -553,7 +553,7 @@ exports[`Draft should render the draft with channel info and draft message 1`] =
}
}
accessible={true}
focusable={false}
focusable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
Expand Down Expand Up @@ -721,7 +721,7 @@ exports[`Draft should render the draft with channel info and draft message for a
}
}
accessible={true}
focusable={false}
focusable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
Expand Down Expand Up @@ -889,7 +889,7 @@ exports[`Draft should render the draft with post priority 1`] = `
}
}
accessible={true}
focusable={false}
focusable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
Expand Down
2 changes: 1 addition & 1 deletion app/components/draft/draft_post/draft_message.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import React from 'react';
import {renderWithEverything} from '@test/intl-test-helper';
import TestHelper from '@test/test_helper';

import DraftMessage from '.';
import DraftMessage from './draft_message';

import type {Database} from '@nozbe/watermelondb';
import type DraftModel from '@typings/database/models/servers/draft';
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,324 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`DraftPostHeader Component renders CompassIcon when draftReceiverUser is not provided 1`] = `
<View
style={
{
"alignItems": "center",
"display": "flex",
"flexDirection": "row",
"justifyContent": "space-between",
}
}
testID="channel-info"
>
<View
style={
{
"alignItems": "center",
"display": "flex",
"flexDirection": "row",
}
}
>
<View
style={
{
"alignItems": "center",
"display": "flex",
"flexDirection": "row",
}
}
>
<View
style={
{
"marginRight": 6,
}
}
>
<View
style={
{
"backgroundColor": "rgba(0,0,0,0.08)",
"borderRadius": 555,
"height": 24,
"padding": 4,
"width": 24,
}
}
/>
</View>
</View>
<Text
style={
{
"color": "rgba(0,0,0,0.64)",
"fontFamily": "OpenSans-SemiBold",
"fontSize": 12,
"fontWeight": "600",
"lineHeight": 16,
}
}
>
Direct Message Channel
</Text>
</View>
</View>
`;

exports[`DraftPostHeader Component renders correctly for a DM channel 1`] = `
<View
style={
{
"alignItems": "center",
"display": "flex",
"flexDirection": "row",
"justifyContent": "space-between",
}
}
testID="channel-info"
>
<View
style={
{
"alignItems": "center",
"display": "flex",
"flexDirection": "row",
}
}
>
<View
style={
{
"alignItems": "center",
"display": "flex",
"flexDirection": "row",
}
}
>
<View
style={
{
"marginRight": 6,
}
}
>
<View
style={
{
"backgroundColor": "rgba(0,0,0,0.08)",
"borderRadius": 555,
"height": 24,
"padding": 4,
"width": 24,
}
}
/>
</View>
</View>
<Text
style={
{
"color": "rgba(0,0,0,0.64)",
"fontFamily": "OpenSans-SemiBold",
"fontSize": 12,
"fontWeight": "600",
"lineHeight": 16,
}
}
>
Direct Message Channel
</Text>
</View>
</View>
`;

exports[`DraftPostHeader Component renders correctly for a public channel 1`] = `
<View
style={
{
"alignItems": "center",
"display": "flex",
"flexDirection": "row",
"justifyContent": "space-between",
}
}
testID="channel-info"
>
<View
style={
{
"alignItems": "center",
"display": "flex",
"flexDirection": "row",
}
}
>
<View
style={
{
"alignItems": "center",
"display": "flex",
"flexDirection": "row",
}
}
>
<View
style={
{
"marginRight": 6,
}
}
>
<View
style={
{
"backgroundColor": "rgba(0,0,0,0.08)",
"borderRadius": 555,
"height": 24,
"padding": 4,
"width": 24,
}
}
/>
</View>
</View>
<Text
style={
{
"color": "rgba(0,0,0,0.64)",
"fontFamily": "OpenSans-SemiBold",
"fontSize": 12,
"fontWeight": "600",
"lineHeight": 16,
}
}
>
Public Channel
</Text>
</View>
</View>
`;

exports[`DraftPostHeader Component renders correctly for a thread 1`] = `
<View
style={
{
"alignItems": "center",
"display": "flex",
"flexDirection": "row",
"justifyContent": "space-between",
}
}
testID="channel-info"
>
<View
style={
{
"alignItems": "center",
"display": "flex",
"flexDirection": "row",
}
}
>
<View
style={
{
"alignItems": "center",
"display": "flex",
"flexDirection": "row",
}
}
>
<View
style={
{
"marginRight": 6,
}
}
>
<View
style={
{
"backgroundColor": "rgba(0,0,0,0.08)",
"borderRadius": 555,
"height": 24,
"padding": 4,
"width": 24,
}
}
/>
</View>
</View>
<Text
style={
{
"color": "rgba(0,0,0,0.64)",
"fontFamily": "OpenSans-SemiBold",
"fontSize": 12,
"fontWeight": "600",
"lineHeight": 16,
}
}
>
Direct Message Channel
</Text>
</View>
</View>
`;

exports[`DraftPostHeader Component renders the Avatar when draftReceiverUser is provided 1`] = `
<View
style={
{
"alignItems": "center",
"display": "flex",
"flexDirection": "row",
"justifyContent": "space-between",
}
}
testID="channel-info"
>
<View
style={
{
"alignItems": "center",
"display": "flex",
"flexDirection": "row",
}
}
>
<View
style={
{
"alignItems": "center",
"display": "flex",
"flexDirection": "row",
}
}
>
<View
style={
{
"marginRight": 6,
}
}
/>
</View>
<Text
style={
{
"color": "rgba(0,0,0,0.64)",
"fontFamily": "OpenSans-SemiBold",
"fontSize": 12,
"fontWeight": "600",
"lineHeight": 16,
}
}
>
Direct Message Channel
</Text>
</View>
</View>
`;
Loading

0 comments on commit 6dfa62c

Please sign in to comment.