Skip to content

Commit

Permalink
Merge branch 'main' into penpot-ms4
Browse files Browse the repository at this point in the history
  • Loading branch information
CHOOSEIT authored May 29, 2024
2 parents 5a28aea + 86997c6 commit 272b029
Show file tree
Hide file tree
Showing 4 changed files with 118 additions and 3 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ Link to the [Penpot Project](https://design.penpot.app/#/workspace/43442e9d-d45f

### Project Architecture Diagram

Here is the first architecture diagram of the application for MS1.
This should give a quick reference/overview on the overall architecture and the relations between the different screens, data sources, and internal state of the application.

<img src="https://github.com/ProximaEPFL/proxima/assets/53620532/a895c3e9-5c80-4c1b-bd87-decf1b1ddaea" alt="Proxima Arichtecture Diagram" width="600">
Expand Down
50 changes: 49 additions & 1 deletion test/models/ui/validation/create_account_validation_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,55 @@ void main() {
accountCreated: true,
);

expect(createAccount, createAccountCopy);
expect(createAccount == createAccountCopy, true);
});

test("equality fails on different uniqueUsernameError", () {
const createAccount = CreateAccountValidation(
uniqueUsernameError: "uniqueUsernameError",
pseudoError: "pseudoError",
accountCreated: true,
);

const createAccountCopy = CreateAccountValidation(
uniqueUsernameError: "uniqueUsernameError2",
pseudoError: "pseudoError",
accountCreated: true,
);

expect(createAccount == createAccountCopy, false);
});

test("equality fails on different pseudoError", () {
const createAccount = CreateAccountValidation(
uniqueUsernameError: "uniqueUsernameError",
pseudoError: "pseudoError",
accountCreated: true,
);

const createAccountCopy = CreateAccountValidation(
uniqueUsernameError: "uniqueUsernameError",
pseudoError: "pseudoError2",
accountCreated: true,
);

expect(createAccount == createAccountCopy, false);
});

test("equality fails on different accountCreated", () {
const createAccount = CreateAccountValidation(
uniqueUsernameError: "uniqueUsernameError",
pseudoError: "pseudoError",
accountCreated: true,
);

const createAccountCopy = CreateAccountValidation(
uniqueUsernameError: "uniqueUsernameError",
pseudoError: "pseudoError",
accountCreated: false,
);

expect(createAccount == createAccountCopy, false);
});
});
}
68 changes: 68 additions & 0 deletions test/models/ui/validation/new_comment_validation_test.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
import "package:flutter_test/flutter_test.dart";
import "package:proxima/models/ui/validation/new_comment_validation.dart";

void main() {
group("New Comment Model Testing", () {
test("hash overrides correctly", () {
// Define the expected result
const newCommentState = NewCommentValidation(
contentError: "contentError",
posted: true,
);

final expectedHash = Object.hash(
newCommentState.contentError,
newCommentState.posted,
);

final actualHash = newCommentState.hashCode;

expect(actualHash, expectedHash);
});

test("equality overrides correctly", () {
// Define the expected result
const newCommentState = NewCommentValidation(
contentError: "commentError",
posted: true,
);

const newCommentStateCopy = NewCommentValidation(
contentError: "commentError",
posted: true,
);

expect(newCommentState == newCommentStateCopy, true);
});

test("equality fails on different contentError", () {
// Define the expected result
const newCommentState = NewCommentValidation(
contentError: "commentError",
posted: true,
);

const newCommentStateCopy = NewCommentValidation(
contentError: "commentError2",
posted: true,
);

expect(newCommentState == newCommentStateCopy, false);
});

test("equality fails on different posted", () {
// Define the expected result
const newCommentState = NewCommentValidation(
contentError: "commentError",
posted: true,
);

const newCommentStateCopy = NewCommentValidation(
contentError: "commentError",
posted: false,
);

expect(newCommentState == newCommentStateCopy, false);
});
});
}
2 changes: 1 addition & 1 deletion test/models/ui/validation/new_post_validation_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import "package:flutter_test/flutter_test.dart";
import "package:proxima/models/ui/validation/new_post_validation.dart";

void main() {
group("Create Account Model testing", () {
group("New Post Model testing", () {
test("hash overrides correctly", () {
final newPostState = NewPostValidation(
titleError: "titleError",
Expand Down

0 comments on commit 272b029

Please sign in to comment.