sforkowany z mirror/soapbox
Temporarily disable for non-PLEROMA/MASTODON
rodzic
c16c363106
commit
16c06e1d60
|
@ -24,155 +24,155 @@ describe('<SubscribeButton />', () => {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('with "accountNotifies" enabled', () => {
|
// describe('with "accountNotifies" enabled', () => {
|
||||||
beforeEach(() => {
|
// beforeEach(() => {
|
||||||
store = {
|
// store = {
|
||||||
...store,
|
// ...store,
|
||||||
instance: normalizeInstance({
|
// instance: normalizeInstance({
|
||||||
version: '3.4.1 (compatible; TruthSocial 1.0.0)',
|
// version: '3.4.1 (compatible; TruthSocial 1.0.0)',
|
||||||
software: 'TRUTHSOCIAL',
|
// software: 'TRUTHSOCIAL',
|
||||||
pleroma: ImmutableMap({}),
|
// pleroma: ImmutableMap({}),
|
||||||
}),
|
// }),
|
||||||
};
|
// };
|
||||||
});
|
// });
|
||||||
|
|
||||||
describe('when the relationship is requested', () => {
|
// describe('when the relationship is requested', () => {
|
||||||
beforeEach(() => {
|
// beforeEach(() => {
|
||||||
account = normalizeAccount({ ...account, relationship: normalizeRelationship({ requested: true }) });
|
// account = normalizeAccount({ ...account, relationship: normalizeRelationship({ requested: true }) });
|
||||||
|
|
||||||
store = {
|
// store = {
|
||||||
...store,
|
// ...store,
|
||||||
accounts: ImmutableMap({
|
// accounts: ImmutableMap({
|
||||||
'1': account,
|
// '1': account,
|
||||||
}),
|
// }),
|
||||||
};
|
// };
|
||||||
});
|
// });
|
||||||
|
|
||||||
it('renders the button', () => {
|
// it('renders the button', () => {
|
||||||
render(<SubscribeButton account={account} />, null, store);
|
// render(<SubscribeButton account={account} />, null, store);
|
||||||
expect(screen.getByTestId('icon-button')).toBeInTheDocument();
|
// expect(screen.getByTestId('icon-button')).toBeInTheDocument();
|
||||||
});
|
// });
|
||||||
|
|
||||||
describe('when the user "isSubscribed"', () => {
|
// describe('when the user "isSubscribed"', () => {
|
||||||
beforeEach(() => {
|
// beforeEach(() => {
|
||||||
account = normalizeAccount({
|
// account = normalizeAccount({
|
||||||
...account,
|
// ...account,
|
||||||
relationship: normalizeRelationship({ requested: true, notifying: true }),
|
// relationship: normalizeRelationship({ requested: true, notifying: true }),
|
||||||
});
|
// });
|
||||||
|
|
||||||
store = {
|
// store = {
|
||||||
...store,
|
// ...store,
|
||||||
accounts: ImmutableMap({
|
// accounts: ImmutableMap({
|
||||||
'1': account,
|
// '1': account,
|
||||||
}),
|
// }),
|
||||||
};
|
// };
|
||||||
});
|
// });
|
||||||
|
|
||||||
it('renders the unsubscribe button', () => {
|
// it('renders the unsubscribe button', () => {
|
||||||
render(<SubscribeButton account={account} />, null, store);
|
// render(<SubscribeButton account={account} />, null, store);
|
||||||
expect(screen.getByTestId('icon-button').title).toEqual(`Unsubscribe to notifications from @${account.acct}`);
|
// expect(screen.getByTestId('icon-button').title).toEqual(`Unsubscribe to notifications from @${account.acct}`);
|
||||||
});
|
// });
|
||||||
});
|
// });
|
||||||
|
|
||||||
describe('when the user is not "isSubscribed"', () => {
|
// describe('when the user is not "isSubscribed"', () => {
|
||||||
beforeEach(() => {
|
// beforeEach(() => {
|
||||||
account = normalizeAccount({
|
// account = normalizeAccount({
|
||||||
...account,
|
// ...account,
|
||||||
relationship: normalizeRelationship({ requested: true, notifying: false }),
|
// relationship: normalizeRelationship({ requested: true, notifying: false }),
|
||||||
});
|
// });
|
||||||
|
|
||||||
store = {
|
// store = {
|
||||||
...store,
|
// ...store,
|
||||||
accounts: ImmutableMap({
|
// accounts: ImmutableMap({
|
||||||
'1': account,
|
// '1': account,
|
||||||
}),
|
// }),
|
||||||
};
|
// };
|
||||||
});
|
// });
|
||||||
|
|
||||||
it('renders the unsubscribe button', () => {
|
// it('renders the unsubscribe button', () => {
|
||||||
render(<SubscribeButton account={account} />, null, store);
|
// render(<SubscribeButton account={account} />, null, store);
|
||||||
expect(screen.getByTestId('icon-button').title).toEqual(`Subscribe to notifications from @${account.acct}`);
|
// expect(screen.getByTestId('icon-button').title).toEqual(`Subscribe to notifications from @${account.acct}`);
|
||||||
});
|
// });
|
||||||
});
|
// });
|
||||||
});
|
// });
|
||||||
|
|
||||||
describe('when the user is not following the account', () => {
|
// describe('when the user is not following the account', () => {
|
||||||
beforeEach(() => {
|
// beforeEach(() => {
|
||||||
account = normalizeAccount({ ...account, relationship: normalizeRelationship({ following: false }) });
|
// account = normalizeAccount({ ...account, relationship: normalizeRelationship({ following: false }) });
|
||||||
|
|
||||||
store = {
|
// store = {
|
||||||
...store,
|
// ...store,
|
||||||
accounts: ImmutableMap({
|
// accounts: ImmutableMap({
|
||||||
'1': account,
|
// '1': account,
|
||||||
}),
|
// }),
|
||||||
};
|
// };
|
||||||
});
|
// });
|
||||||
|
|
||||||
it('renders nothing', () => {
|
// it('renders nothing', () => {
|
||||||
render(<SubscribeButton account={account} />, null, store);
|
// render(<SubscribeButton account={account} />, null, store);
|
||||||
expect(screen.queryAllByTestId('icon-button')).toHaveLength(0);
|
// expect(screen.queryAllByTestId('icon-button')).toHaveLength(0);
|
||||||
});
|
// });
|
||||||
});
|
// });
|
||||||
|
|
||||||
describe('when the user is following the account', () => {
|
// describe('when the user is following the account', () => {
|
||||||
beforeEach(() => {
|
// beforeEach(() => {
|
||||||
account = normalizeAccount({ ...account, relationship: normalizeRelationship({ following: true }) });
|
// account = normalizeAccount({ ...account, relationship: normalizeRelationship({ following: true }) });
|
||||||
|
|
||||||
store = {
|
// store = {
|
||||||
...store,
|
// ...store,
|
||||||
accounts: ImmutableMap({
|
// accounts: ImmutableMap({
|
||||||
'1': account,
|
// '1': account,
|
||||||
}),
|
// }),
|
||||||
};
|
// };
|
||||||
});
|
// });
|
||||||
|
|
||||||
it('renders the button', () => {
|
// it('renders the button', () => {
|
||||||
render(<SubscribeButton account={account} />, null, store);
|
// render(<SubscribeButton account={account} />, null, store);
|
||||||
expect(screen.getByTestId('icon-button')).toBeInTheDocument();
|
// expect(screen.getByTestId('icon-button')).toBeInTheDocument();
|
||||||
});
|
// });
|
||||||
|
|
||||||
describe('when the user "isSubscribed"', () => {
|
// describe('when the user "isSubscribed"', () => {
|
||||||
beforeEach(() => {
|
// beforeEach(() => {
|
||||||
account = normalizeAccount({
|
// account = normalizeAccount({
|
||||||
...account,
|
// ...account,
|
||||||
relationship: normalizeRelationship({ requested: true, notifying: true }),
|
// relationship: normalizeRelationship({ requested: true, notifying: true }),
|
||||||
});
|
// });
|
||||||
|
|
||||||
store = {
|
// store = {
|
||||||
...store,
|
// ...store,
|
||||||
accounts: ImmutableMap({
|
// accounts: ImmutableMap({
|
||||||
'1': account,
|
// '1': account,
|
||||||
}),
|
// }),
|
||||||
};
|
// };
|
||||||
});
|
// });
|
||||||
|
|
||||||
it('renders the unsubscribe button', () => {
|
// it('renders the unsubscribe button', () => {
|
||||||
render(<SubscribeButton account={account} />, null, store);
|
// render(<SubscribeButton account={account} />, null, store);
|
||||||
expect(screen.getByTestId('icon-button').title).toEqual(`Unsubscribe to notifications from @${account.acct}`);
|
// expect(screen.getByTestId('icon-button').title).toEqual(`Unsubscribe to notifications from @${account.acct}`);
|
||||||
});
|
// });
|
||||||
});
|
// });
|
||||||
|
|
||||||
describe('when the user is not "isSubscribed"', () => {
|
// describe('when the user is not "isSubscribed"', () => {
|
||||||
beforeEach(() => {
|
// beforeEach(() => {
|
||||||
account = normalizeAccount({
|
// account = normalizeAccount({
|
||||||
...account,
|
// ...account,
|
||||||
relationship: normalizeRelationship({ requested: true, notifying: false }),
|
// relationship: normalizeRelationship({ requested: true, notifying: false }),
|
||||||
});
|
// });
|
||||||
|
|
||||||
store = {
|
// store = {
|
||||||
...store,
|
// ...store,
|
||||||
accounts: ImmutableMap({
|
// accounts: ImmutableMap({
|
||||||
'1': account,
|
// '1': account,
|
||||||
}),
|
// }),
|
||||||
};
|
// };
|
||||||
});
|
// });
|
||||||
|
|
||||||
it('renders the unsubscribe button', () => {
|
// it('renders the unsubscribe button', () => {
|
||||||
render(<SubscribeButton account={account} />, null, store);
|
// render(<SubscribeButton account={account} />, null, store);
|
||||||
expect(screen.getByTestId('icon-button').title).toEqual(`Subscribe to notifications from @${account.acct}`);
|
// expect(screen.getByTestId('icon-button').title).toEqual(`Subscribe to notifications from @${account.acct}`);
|
||||||
});
|
// });
|
||||||
});
|
// });
|
||||||
});
|
// });
|
||||||
});
|
// });
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -126,7 +126,7 @@ const getInstanceFeatures = (instance: Instance) => {
|
||||||
accountNotifies: any([
|
accountNotifies: any([
|
||||||
v.software === MASTODON && gte(v.compatVersion, '3.3.0'),
|
v.software === MASTODON && gte(v.compatVersion, '3.3.0'),
|
||||||
v.software === PLEROMA && gte(v.version, '2.4.50'),
|
v.software === PLEROMA && gte(v.version, '2.4.50'),
|
||||||
v.software === TRUTHSOCIAL,
|
// v.software === TRUTHSOCIAL,
|
||||||
]),
|
]),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Ładowanie…
Reference in New Issue