Fix the remaining PNP mock tests

This commit is contained in:
Scott Nonnenberg
2025-09-26 03:31:23 +10:00
committed by GitHub
parent 57c7714e5f
commit 3af511fb5d
4 changed files with 15 additions and 27 deletions

View File

@@ -236,7 +236,7 @@
"@indutny/parallel-prettier": "3.0.0",
"@indutny/rezip-electron": "2.0.1",
"@napi-rs/canvas": "0.1.61",
"@signalapp/mock-server": "14.0.0",
"@signalapp/mock-server": "14.1.1",
"@storybook/addon-a11y": "8.4.4",
"@storybook/addon-actions": "8.4.4",
"@storybook/addon-controls": "8.4.4",

10
pnpm-lock.yaml generated
View File

@@ -439,8 +439,8 @@ importers:
specifier: 0.1.61
version: 0.1.61
'@signalapp/mock-server':
specifier: 14.0.0
version: 14.0.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)
specifier: 14.1.1
version: 14.1.1(bufferutil@4.0.9)(utf-8-validate@5.0.10)
'@storybook/addon-a11y':
specifier: 8.4.4
version: 8.4.4(storybook@8.4.4(bufferutil@4.0.9)(prettier@3.3.3)(utf-8-validate@5.0.10))
@@ -3461,8 +3461,8 @@ packages:
'@signalapp/minimask@1.0.1':
resolution: {integrity: sha512-QAwo0joA60urTNbW9RIz6vLKQjy+jdVtH7cvY0wD9PVooD46MAjE40MLssp4xUJrph91n2XvtJ3pbEUDrmT2AA==}
'@signalapp/mock-server@14.0.0':
resolution: {integrity: sha512-zoycqL/z2ysge+4S2Sp3/KPfMqBCDDzGAnAQA7K6Yakel8opsQzjEPcXIR0c0hNrn3vHlZ+MoDiXRmavEpSzOQ==}
'@signalapp/mock-server@14.1.1':
resolution: {integrity: sha512-NmzW4fsbKtHqb/aOtrxCw43ir0Yhpxy776ifHWYL0Fd+4fz3J7EVbNTTgDmYc4iOncM+z/GcrSOzMnPp8RMoWQ==}
'@signalapp/parchment-cjs@3.0.1':
resolution: {integrity: sha512-hSBMQ1M7wE4GcC8ZeNtvpJF+DAJg3eIRRf1SiHS3I3Algav/sgJJNm6HIYm6muHuK7IJmuEjkL3ILSXgmu0RfQ==}
@@ -14227,7 +14227,7 @@ snapshots:
'@signalapp/minimask@1.0.1': {}
'@signalapp/mock-server@14.0.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)':
'@signalapp/mock-server@14.1.1(bufferutil@4.0.9)(utf-8-validate@5.0.10)':
dependencies:
'@indutny/parallel-prettier': 3.0.0(prettier@3.3.3)
'@signalapp/libsignal-client': 0.76.7

View File

@@ -527,35 +527,22 @@ describe('pnp/merge', function (this: Mocha.Suite) {
assert.strictEqual(await messages.count(), 1, 'message count');
}
debug('Find and open e164 conversation');
debug('Search for phone number, see that nothing comes up');
const searchBox = window.locator(
'.module-SearchInput__input.LeftPaneSearchInput__input'
);
await typeIntoInput(searchBox, aciContact.device.number, '');
const firstSearchResult = await window.locator(
'.module-contact-name.module-conversation-list__item--contact-or-conversation__content__header__name__contact-name'
'.module-left-pane__no-search-results'
);
const firstSearchResultText = await firstSearchResult.innerText();
assert.equal(
firstSearchResultText.slice(-4),
aciContact.device.number.slice(-4),
'no profile, just phone number'
firstSearchResultText,
`No results for "${aciContact.device.number}"`,
'found something unexpected for e164 search'
);
await firstSearchResult.click();
debug('Wait for ACI conversation to go away');
await window
.locator(`.module-conversation-hero >> "${pniContact.profileName}"`)
.waitFor({
state: 'hidden',
});
debug('Verify absence of messages in the e164 conversation');
{
const messages = window.locator('.module-message__text');
assert.strictEqual(await messages.count(), 0, 'message count');
}
});
it('preserves expireTimerVersion after merge', async () => {

View File

@@ -4,16 +4,17 @@
import type { ServiceIdString } from '../types/ServiceId.js';
export type MinimalConversationType = Readonly<{
type?: string;
discoveredUnregisteredAt?: number;
e164?: string;
serviceId?: ServiceIdString;
discoveredUnregisteredAt?: number;
type?: string;
}>;
export function isConversationSMSOnly(
conversation: MinimalConversationType
): boolean {
const { e164, serviceId, type } = conversation;
// `direct` for redux, `private` for models and the database
if (type !== 'direct' && type !== 'private') {
return false;