Skip to content

Commit

Permalink
Repetindo o commit
Browse files Browse the repository at this point in the history
Repetindo o commit para descartar a possibilidade de ter esquecido de subir algo
  • Loading branch information
Kauan-F20 committed Jan 31, 2025
1 parent 1e5f8b3 commit 7737c9f
Show file tree
Hide file tree
Showing 15 changed files with 93 additions and 279 deletions.
11 changes: 6 additions & 5 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,13 @@
"plugins": [
"expo-router",
[
"expo-build-properties",
{
"android": {
"usesCleartextTraffic": true
"expo-build-properties",
{
"android": {
"usesCleartextTraffic": true
}
}
}
]
],
"extra": {
"expoEnv": "process.env.EXPO_PUBLIC_API_URL",
Expand Down
3 changes: 2 additions & 1 deletion eas.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
"android": {
"buildType": "apk"
},
},
"channel": "production"
}
},
"submit": {
"production": {}
Expand Down
80 changes: 8 additions & 72 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 1 addition & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,11 @@
"dependencies": {
"@expo/metro-config": "^0.18.11",
"@expo/vector-icons": "^14.0.2",
"@fortawesome/free-solid-svg-icons": "^6.7.2",
"@fortawesome/react-fontawesome": "^0.2.2",
"@nozbe/watermelondb": "^0.27.1",
"@react-native-async-storage/async-storage": "1.23.1",
"@shopify/flash-list": "1.6.4",
"@testing-library/jest-native": "^5.4.3",
"axios": "^1.7.9",
"axios": "^1.5.1",
"date-fns": "^2.30.0",
"expo": "^51.0.39",
"expo-build-properties": "~0.12.5",
Expand Down Expand Up @@ -51,7 +49,6 @@
"react-native": "0.74.5",
"react-native-calendar-strip": "^2.2.6",
"react-native-calendars": "^1.1302.0",
"react-native-dotenv": "^3.4.11",
"react-native-draggable-gridview": "^1.0.3",
"react-native-dropdown-select-list": "^2.0.5",
"react-native-gesture-handler": "~2.16.1",
Expand Down
50 changes: 0 additions & 50 deletions src/app/__tests__/Publicacao.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,54 +82,4 @@ describe("Publicacao", () => {
params: expectedParams,
});
});

it("deve exibir a foto se o item tiver uma foto", () => {
render(<Publicacao item={mockItemComFoto} crop={false} />);

// Verifique se a foto está presente
const fotoElement = screen.getByText("data:image/png;base64,base64-encoded-image-data");
expect(fotoElement).toBeTruthy();
});

it("não deve exibir foto", () => {
render(<Publicacao item={mockItemSemFoto} crop={false} />);

// Verifique se a foto está presente
const fotoElement = screen.getByPlaceholderText("foto");
expect(fotoElement).toBeNull();
});
// verifica o crop para o nome gigante, como JOAO NOME GRANDE QUE TESTA O CODIGO 2
it("deve exibir o nome do usuário cortado se a prop crop for true e o nome for longo", () => {
const longName = "Nome do Usuário com um nome bem longo";
const mockItemComNomeLongo = {
...mockItem,
usuario: { ...mockItem.usuario, nome: longName }
};

render(<Publicacao item={mockItemComNomeLongo} crop={true} />);

const usernameElement = screen.getByText("Nome do Usuário com");
expect(usernameElement).toBeTruthy(); // O nome deve ser cortado
});
// verifica se o crop funciona para o título
it("deve exibir o título da publicação cortado se a prop crop for true e o título for longo", () => {
const longTitle = "Título da publicação que é muito longo e precisa ser cortado";
const mockItemComTituloLongo = { ...mockItem, titulo: longTitle };

render(<Publicacao item={mockItemComTituloLongo} crop={true} />);

const titleElement = screen.getByText("Título da publicação que");
expect(titleElement).toBeTruthy(); // O título deve ser cortado
});

// para nomes enormes e descrições maiores ainda, deve cortar para evitar o texto aparecer inteiro na tela.
it("deve exibir a descrição da publicação cortada se a prop crop for true e a descrição for longa", () => {
const longDescription = "Descrição da publicação que é bem longa e vai ser cortada aqui para testar o funcionamento do crop";
const mockItemComDescricaoLonga = { ...mockItem, descricao: longDescription };

render(<Publicacao item={mockItemComDescricaoLonga} crop={true} />);

const descriptionElement = screen.getByText("Descrição da publicação que");
expect(descriptionElement).toBeTruthy(); // A descrição deve ser cortada
});
});
5 changes: 0 additions & 5 deletions src/app/__tests__/PublicacaoVisualizar.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,4 @@ describe("PublicacaoVisualizar", () => {
const dateElement = screen.getByText("04/11/2023");
expect(dateElement).toBeTruthy();
});
it("deve renderizar a descrição corretamente", () => {
render(<PublicacaoVisualizar item={mockItem} />);
const descricaoElement = screen.getByText(mockItem.descricao);
expect(descricaoElement).toBeTruthy();
});
});
2 changes: 1 addition & 1 deletion src/app/__tests__/editarPublicacao.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ describe('EditarPublicacao', () => {
const mockPublicacao = {
id: '1',
titulo: 'Test Title',
descricao: 'Test Description, should be different them the Profile Description',
descricao: 'Test Description',
categoria: 'GERAL',
// Adicione outros campos necessários aqui
};
Expand Down
12 changes: 4 additions & 8 deletions src/app/components/Publicacao.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,7 @@ export default function Publicacao({ item, crop }: Readonly<IProps>) {
};

const navigate = () => {
const params = { ...item,
id: item.id,
foto: item.usuario?.foto,
nome: item.usuario?.nome,
};
const params = { ...item, ...item.usuario, id: item.id };

router.push({
pathname: "/private/pages/visualizarPublicacao",
Expand All @@ -66,7 +62,7 @@ export default function Publicacao({ item, crop }: Readonly<IProps>) {
const getDescricao = (descricao: string): string => {
if (!crop) return descricao;

return descricao.length < 250 ? descricao : descricao.slice(0, 250) + "...";
return descricao.length < 150 ? descricao : descricao.slice(0, 150) + "...";
};

return (
Expand Down Expand Up @@ -142,7 +138,7 @@ const styles = StyleSheet.create({
marginLeft: 10,
},
postContent: {
fontSize: 15,
fontSize: 16,
marginTop: 15,
},
fotoPerfil: {
Expand All @@ -161,7 +157,7 @@ const styles = StyleSheet.create({
zIndex: 1,
},
username: {
color: "#000001",
color: "#000000",
opacity: 0.5,
fontSize: 13,
},
Expand Down
20 changes: 9 additions & 11 deletions src/app/components/PublicacaoVisualizar.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react";
import { View, Image, Text, StyleSheet } from "react-native";
import { IPublicacao, IPublicacaoBody, IPublicacaoUsuario } from "../interfaces/forum.interface";
import { IPublicacaoUsuario } from "../interfaces/forum.interface";
import Icon from "react-native-vector-icons/MaterialCommunityIcons";
import AntDesing from "react-native-vector-icons/AntDesign";
import { hasFoto } from "../shared/helpers/foto.helper";
Expand All @@ -23,7 +23,7 @@ export default function PublicacaoVisualizar({ item }: IProps) {
<Text style={styles.username}>{item.nome || "Usuário deletado"}</Text>
</View>
<Text style={styles.titulo}>{item.titulo}</Text>
<Text style={styles.descricao}> {item.descricao || "Descrição indisponível"} </Text>
<Text style={styles.descricao}>{item.descricao}</Text>
<View style={styles.underInfo}>
<Text style={styles.categoria}>{item.categoria}</Text>
<Text style={styles.date}>{getFormattedDate(item.dataHora)}</Text>
Expand Down Expand Up @@ -63,15 +63,14 @@ const styles = StyleSheet.create({
fotoPerfil: {
width: 65,
aspectRatio: 1,
borderRadius: 140,
borderRadius: 100,
},
username: {
color: "#b4026d",
opacity: 0.8,
fontSize: 18,
marginLeft: 13,
marginBottom: 3,
fontWeight: "600",
color: "#000000",
opacity: 0.6,
fontSize: 16,
marginLeft: 15,
fontWeight: "500",
width: "80%",
},
titulo: {
Expand All @@ -81,8 +80,7 @@ const styles = StyleSheet.create({
},
descricao: {
fontSize: 14,
marginTop: 20,
color: "#0000000",
marginTop: 25,
},
underInfo: {
flexDirection: "row",
Expand Down
2 changes: 1 addition & 1 deletion src/app/interfaces/forum.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export interface IPublicacaoParams extends IPublicacaoBody, IUser {
idUsuarioReporte: string;
}

export interface IPublicacaoUsuario extends IPublicacao, IUser {}
export interface IPublicacaoUsuario extends IPublicacao, IUser { }

export interface IPublicacaoFilter {
titulo?: string;
Expand Down
Loading

0 comments on commit 7737c9f

Please sign in to comment.