mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
Fix broken tests.
// FREEBIE
This commit is contained in:
parent
0b28285deb
commit
f584c4b434
|
@ -100,7 +100,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||||
TSInteraction *interaction = ((OWSCall *)messageData).interaction;
|
TSInteraction *interaction = ((OWSCall *)messageData).interaction;
|
||||||
return [self sizeForSystemMessage:interaction cacheKey:cacheKey layout:layout];
|
return [self sizeForSystemMessage:interaction cacheKey:cacheKey layout:layout];
|
||||||
} else {
|
} else {
|
||||||
OWSFail(@"Can't size unknown message data type: %@", [messageData class]);
|
// Ignore unknown message types; the tests use mocks.
|
||||||
}
|
}
|
||||||
|
|
||||||
// BEGIN HACK iOS10EmojiBug see: https://github.com/WhisperSystems/Signal-iOS/issues/1368
|
// BEGIN HACK iOS10EmojiBug see: https://github.com/WhisperSystems/Signal-iOS/issues/1368
|
||||||
|
|
|
@ -103,6 +103,7 @@
|
||||||
{
|
{
|
||||||
TSAttachmentStream *videoAttachment =
|
TSAttachmentStream *videoAttachment =
|
||||||
[[TSAttachmentStream alloc] initWithContentType:@"video/mp4" sourceFilename:nil];
|
[[TSAttachmentStream alloc] initWithContentType:@"video/mp4" sourceFilename:nil];
|
||||||
|
[videoAttachment save];
|
||||||
self.messageAdapter.mediaItem = [[TSVideoAttachmentAdapter alloc] initWithAttachment:videoAttachment incoming:NO];
|
self.messageAdapter.mediaItem = [[TSVideoAttachmentAdapter alloc] initWithAttachment:videoAttachment incoming:NO];
|
||||||
|
|
||||||
XCTAssertTrue([self.messageAdapter canPerformEditingAction:@selector(delete:)]);
|
XCTAssertTrue([self.messageAdapter canPerformEditingAction:@selector(delete:)]);
|
||||||
|
@ -117,6 +118,7 @@
|
||||||
{
|
{
|
||||||
TSAttachmentStream *audioAttachment =
|
TSAttachmentStream *audioAttachment =
|
||||||
[[TSAttachmentStream alloc] initWithContentType:@"audio/mp3" sourceFilename:nil];
|
[[TSAttachmentStream alloc] initWithContentType:@"audio/mp3" sourceFilename:nil];
|
||||||
|
[audioAttachment save];
|
||||||
self.messageAdapter.mediaItem = [[TSVideoAttachmentAdapter alloc] initWithAttachment:audioAttachment incoming:NO];
|
self.messageAdapter.mediaItem = [[TSVideoAttachmentAdapter alloc] initWithAttachment:audioAttachment incoming:NO];
|
||||||
|
|
||||||
XCTAssertTrue([self.messageAdapter canPerformEditingAction:@selector(delete:)]);
|
XCTAssertTrue([self.messageAdapter canPerformEditingAction:@selector(delete:)]);
|
||||||
|
@ -252,6 +254,7 @@
|
||||||
TSAttachmentStream *videoAttachment =
|
TSAttachmentStream *videoAttachment =
|
||||||
[[TSAttachmentStream alloc] initWithContentType:@"video/mp4" sourceFilename:nil];
|
[[TSAttachmentStream alloc] initWithContentType:@"video/mp4" sourceFilename:nil];
|
||||||
[videoAttachment writeData:self.fakeVideoData error:&error];
|
[videoAttachment writeData:self.fakeVideoData error:&error];
|
||||||
|
[videoAttachment save];
|
||||||
self.messageAdapter.mediaItem = [[TSVideoAttachmentAdapter alloc] initWithAttachment:videoAttachment incoming:YES];
|
self.messageAdapter.mediaItem = [[TSVideoAttachmentAdapter alloc] initWithAttachment:videoAttachment incoming:YES];
|
||||||
|
|
||||||
[self.messageAdapter performEditingAction:@selector(copy:)];
|
[self.messageAdapter performEditingAction:@selector(copy:)];
|
||||||
|
@ -269,6 +272,7 @@
|
||||||
TSAttachmentStream *audioAttachment =
|
TSAttachmentStream *audioAttachment =
|
||||||
[[TSAttachmentStream alloc] initWithContentType:@"audio/mp3" sourceFilename:nil];
|
[[TSAttachmentStream alloc] initWithContentType:@"audio/mp3" sourceFilename:nil];
|
||||||
[audioAttachment writeData:self.fakeAudioData error:&error];
|
[audioAttachment writeData:self.fakeAudioData error:&error];
|
||||||
|
[audioAttachment save];
|
||||||
self.messageAdapter.mediaItem = [[TSVideoAttachmentAdapter alloc] initWithAttachment:audioAttachment incoming:NO];
|
self.messageAdapter.mediaItem = [[TSVideoAttachmentAdapter alloc] initWithAttachment:audioAttachment incoming:NO];
|
||||||
|
|
||||||
[self.messageAdapter performEditingAction:@selector(copy:)];
|
[self.messageAdapter performEditingAction:@selector(copy:)];
|
||||||
|
@ -284,6 +288,7 @@
|
||||||
TSAttachmentStream *audioAttachment =
|
TSAttachmentStream *audioAttachment =
|
||||||
[[TSAttachmentStream alloc] initWithContentType:@"audio/x-m4a" sourceFilename:nil];
|
[[TSAttachmentStream alloc] initWithContentType:@"audio/x-m4a" sourceFilename:nil];
|
||||||
[audioAttachment writeData:self.fakeAudioData error:&error];
|
[audioAttachment writeData:self.fakeAudioData error:&error];
|
||||||
|
[audioAttachment save];
|
||||||
self.messageAdapter.mediaItem = [[TSVideoAttachmentAdapter alloc] initWithAttachment:audioAttachment incoming:NO];
|
self.messageAdapter.mediaItem = [[TSVideoAttachmentAdapter alloc] initWithAttachment:audioAttachment incoming:NO];
|
||||||
|
|
||||||
[self.messageAdapter performEditingAction:@selector(copy:)];
|
[self.messageAdapter performEditingAction:@selector(copy:)];
|
||||||
|
@ -299,6 +304,7 @@
|
||||||
TSAttachmentStream *audioAttachment =
|
TSAttachmentStream *audioAttachment =
|
||||||
[[TSAttachmentStream alloc] initWithContentType:@"audio/wav" sourceFilename:nil];
|
[[TSAttachmentStream alloc] initWithContentType:@"audio/wav" sourceFilename:nil];
|
||||||
[audioAttachment writeData:self.fakeAudioData error:&error];
|
[audioAttachment writeData:self.fakeAudioData error:&error];
|
||||||
|
[audioAttachment save];
|
||||||
self.messageAdapter.mediaItem = [[TSVideoAttachmentAdapter alloc] initWithAttachment:audioAttachment incoming:NO];
|
self.messageAdapter.mediaItem = [[TSVideoAttachmentAdapter alloc] initWithAttachment:audioAttachment incoming:NO];
|
||||||
|
|
||||||
[self.messageAdapter performEditingAction:@selector(copy:)];
|
[self.messageAdapter performEditingAction:@selector(copy:)];
|
||||||
|
|
Loading…
Reference in a new issue