Skip to content

Commit

Permalink
fix some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Bilb committed Nov 24, 2020
1 parent 51ea762 commit 291d468
Show file tree
Hide file tree
Showing 15 changed files with 40 additions and 438 deletions.
7 changes: 6 additions & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,12 @@ module.exports = grunt => {
tasks: ['sass'],
},
transpile: {
files: ['./ts/**/*.ts', './ts/**/*.tsx', './ts/**/**/*.tsx'],
files: [
'./ts/**/*.ts',
'./ts/**/*.tsx',
'./ts/**/**/*.tsx',
'./test/ts/**.ts',
],
tasks: ['exec:transpile'],
},
},
Expand Down
1 change: 1 addition & 0 deletions js/ConversationController.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ export type ConversationControllerType = {
getOrThrow: (id: string) => ConversationModel;
getOrCreateAndWait: (id: string, type: string) => Promise<ConversationModel>;
getOrCreate: (id: string, type: string) => Promise<ConversationModel>;
dangerouslyCreateAndAdd: (any) => any;
};
4 changes: 2 additions & 2 deletions password.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
<body>
<div class='app-loading-screen'>
<div class="content session-full-logo">
<img src="images/session/brand.svg" class="session-brand-logo" />
<img src="images/session/session-text.svg" class="session-text-logo" />
<img src="images/session/brand.svg" class="session-brand-logo" />
<img src="images/session/session-text.svg" class="session-text-logo" />
</div>
</div>
<script type='text/javascript' src='js/password_start.js'></script>
Expand Down
6 changes: 4 additions & 2 deletions test/backup_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -487,8 +487,10 @@ describe('Backup', () => {

console.log('Backup test: Create models, save to db/disk');
const message = await upgradeMessageSchema(messageWithAttachments);
console.log({ message });
await message.commit();
await window.Signal.Data.saveMessage(message, {
Message: Whisper.Message,
forceSave: true,
});

const conversation = {
active_at: 1524185933350,
Expand Down
12 changes: 6 additions & 6 deletions test/fixtures.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/* global Whisper */

Whisper.Fixtures = () => {
const VERA_ID = '+13016886524'; // nsa
const NESTOR_ID = '+17034820623'; // cia
const MASHA_ID = '+441242221491'; // gchq
const FRED_ID = '+14155537400'; // fbi sf
const MICHEL_ID = '+12024561111'; // twh
const VERA_ID = '0501cd123456789abcdef05123456789abcdef05123456789abcdef05123456789'; // nsa
const NESTOR_ID = '0502cd123456789abcdef05123456789abcdef05123456789abcdef05123456789'; // cia
const MASHA_ID = '0503cd123456789abcdef05123456789abcdef05123456789abcdef05123456789'; // gchq
const FRED_ID = '0504cd123456789abcdef05123456789abcdef05123456789abcdef05123456789'; // fbi sf
const MICHEL_ID = '0505cd123456789abcdef05123456789abcdef05123456789abcdef05123456789'; // twh

const now = Date.now();
const conversationCollection = new Whisper.ConversationCollection([
Expand Down Expand Up @@ -172,7 +172,7 @@ Whisper.Fixtures = () => {
type: 'group',
active_at: now - 100000,
timestamp: now - 100000,
id: 'group1',
id: '05abcd123456789abcdef05123456789abcdef05123456789abcdef05123456789',
lastMessage: 'See you all there!',
members: [MICHEL_ID, FRED_ID, NESTOR_ID],
});
Expand Down
4 changes: 1 addition & 3 deletions test/fixtures_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ describe('Fixtures', () => {

await clearDatabase();
await textsecure.storage.user.setNumberAndDeviceId(
'+17015552000',
'05123456789abcdef05123456789abcdef05123456789abcdef05123456789abcd',
2,
'testDevice'
);
Expand All @@ -27,12 +27,10 @@ describe('Fixtures', () => {
await ConversationController.load();

let view = new Whisper.InboxView({ window });
view.onEmpty();
view.$el.prependTo($('#render-light-theme'));

view = new Whisper.InboxView({ window });
view.$el.removeClass('light-theme').addClass('dark-theme');
view.onEmpty();
view.$el.prependTo($('#render-dark-theme'));
});
});
4 changes: 2 additions & 2 deletions test/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@

<script type="text/x-tmpl-mustache" id="app-loading-screen">
<div class="content session-full-logo">
<img src="images/session/brand.svg" class="session-brand-logo" />
<img src="images/session/session-text.svg" class="session-text-logo" />
<img src="../images/session/brand.svg" class="session-brand-logo" />
<img src="../images/session/session-text.svg" class="session-text-logo" />
</div>
</script>

Expand Down
79 changes: 0 additions & 79 deletions test/keychange_listener_test.js

This file was deleted.

Loading

0 comments on commit 291d468

Please sign in to comment.