Temporarily disable for non-PLEROMA/MASTODON

This commit is contained in:
Justin 2022-06-17 07:47:21 -04:00
parent c16c363106
commit 16c06e1d60
2 changed files with 130 additions and 130 deletions

View file

@ -24,155 +24,155 @@ describe('<SubscribeButton />', () => {
});
});
describe('with "accountNotifies" enabled', () => {
beforeEach(() => {
store = {
...store,
instance: normalizeInstance({
version: '3.4.1 (compatible; TruthSocial 1.0.0)',
software: 'TRUTHSOCIAL',
pleroma: ImmutableMap({}),
}),
};
});
// describe('with "accountNotifies" enabled', () => {
// beforeEach(() => {
// store = {
// ...store,
// instance: normalizeInstance({
// version: '3.4.1 (compatible; TruthSocial 1.0.0)',
// software: 'TRUTHSOCIAL',
// pleroma: ImmutableMap({}),
// }),
// };
// });
describe('when the relationship is requested', () => {
beforeEach(() => {
account = normalizeAccount({ ...account, relationship: normalizeRelationship({ requested: true }) });
// describe('when the relationship is requested', () => {
// beforeEach(() => {
// account = normalizeAccount({ ...account, relationship: normalizeRelationship({ requested: true }) });
store = {
...store,
accounts: ImmutableMap({
'1': account,
}),
};
});
// store = {
// ...store,
// accounts: ImmutableMap({
// '1': account,
// }),
// };
// });
it('renders the button', () => {
render(<SubscribeButton account={account} />, null, store);
expect(screen.getByTestId('icon-button')).toBeInTheDocument();
});
// it('renders the button', () => {
// render(<SubscribeButton account={account} />, null, store);
// expect(screen.getByTestId('icon-button')).toBeInTheDocument();
// });
describe('when the user "isSubscribed"', () => {
beforeEach(() => {
account = normalizeAccount({
...account,
relationship: normalizeRelationship({ requested: true, notifying: true }),
});
// describe('when the user "isSubscribed"', () => {
// beforeEach(() => {
// account = normalizeAccount({
// ...account,
// relationship: normalizeRelationship({ requested: true, notifying: true }),
// });
store = {
...store,
accounts: ImmutableMap({
'1': account,
}),
};
});
// store = {
// ...store,
// accounts: ImmutableMap({
// '1': account,
// }),
// };
// });
it('renders the unsubscribe button', () => {
render(<SubscribeButton account={account} />, null, store);
expect(screen.getByTestId('icon-button').title).toEqual(`Unsubscribe to notifications from @${account.acct}`);
});
});
// it('renders the unsubscribe button', () => {
// render(<SubscribeButton account={account} />, null, store);
// expect(screen.getByTestId('icon-button').title).toEqual(`Unsubscribe to notifications from @${account.acct}`);
// });
// });
describe('when the user is not "isSubscribed"', () => {
beforeEach(() => {
account = normalizeAccount({
...account,
relationship: normalizeRelationship({ requested: true, notifying: false }),
});
// describe('when the user is not "isSubscribed"', () => {
// beforeEach(() => {
// account = normalizeAccount({
// ...account,
// relationship: normalizeRelationship({ requested: true, notifying: false }),
// });
store = {
...store,
accounts: ImmutableMap({
'1': account,
}),
};
});
// store = {
// ...store,
// accounts: ImmutableMap({
// '1': account,
// }),
// };
// });
it('renders the unsubscribe button', () => {
render(<SubscribeButton account={account} />, null, store);
expect(screen.getByTestId('icon-button').title).toEqual(`Subscribe to notifications from @${account.acct}`);
});
});
});
// it('renders the unsubscribe button', () => {
// render(<SubscribeButton account={account} />, null, store);
// expect(screen.getByTestId('icon-button').title).toEqual(`Subscribe to notifications from @${account.acct}`);
// });
// });
// });
describe('when the user is not following the account', () => {
beforeEach(() => {
account = normalizeAccount({ ...account, relationship: normalizeRelationship({ following: false }) });
// describe('when the user is not following the account', () => {
// beforeEach(() => {
// account = normalizeAccount({ ...account, relationship: normalizeRelationship({ following: false }) });
store = {
...store,
accounts: ImmutableMap({
'1': account,
}),
};
});
// store = {
// ...store,
// accounts: ImmutableMap({
// '1': account,
// }),
// };
// });
it('renders nothing', () => {
render(<SubscribeButton account={account} />, null, store);
expect(screen.queryAllByTestId('icon-button')).toHaveLength(0);
});
});
// it('renders nothing', () => {
// render(<SubscribeButton account={account} />, null, store);
// expect(screen.queryAllByTestId('icon-button')).toHaveLength(0);
// });
// });
describe('when the user is following the account', () => {
beforeEach(() => {
account = normalizeAccount({ ...account, relationship: normalizeRelationship({ following: true }) });
// describe('when the user is following the account', () => {
// beforeEach(() => {
// account = normalizeAccount({ ...account, relationship: normalizeRelationship({ following: true }) });
store = {
...store,
accounts: ImmutableMap({
'1': account,
}),
};
});
// store = {
// ...store,
// accounts: ImmutableMap({
// '1': account,
// }),
// };
// });
it('renders the button', () => {
render(<SubscribeButton account={account} />, null, store);
expect(screen.getByTestId('icon-button')).toBeInTheDocument();
});
// it('renders the button', () => {
// render(<SubscribeButton account={account} />, null, store);
// expect(screen.getByTestId('icon-button')).toBeInTheDocument();
// });
describe('when the user "isSubscribed"', () => {
beforeEach(() => {
account = normalizeAccount({
...account,
relationship: normalizeRelationship({ requested: true, notifying: true }),
});
// describe('when the user "isSubscribed"', () => {
// beforeEach(() => {
// account = normalizeAccount({
// ...account,
// relationship: normalizeRelationship({ requested: true, notifying: true }),
// });
store = {
...store,
accounts: ImmutableMap({
'1': account,
}),
};
});
// store = {
// ...store,
// accounts: ImmutableMap({
// '1': account,
// }),
// };
// });
it('renders the unsubscribe button', () => {
render(<SubscribeButton account={account} />, null, store);
expect(screen.getByTestId('icon-button').title).toEqual(`Unsubscribe to notifications from @${account.acct}`);
});
});
// it('renders the unsubscribe button', () => {
// render(<SubscribeButton account={account} />, null, store);
// expect(screen.getByTestId('icon-button').title).toEqual(`Unsubscribe to notifications from @${account.acct}`);
// });
// });
describe('when the user is not "isSubscribed"', () => {
beforeEach(() => {
account = normalizeAccount({
...account,
relationship: normalizeRelationship({ requested: true, notifying: false }),
});
// describe('when the user is not "isSubscribed"', () => {
// beforeEach(() => {
// account = normalizeAccount({
// ...account,
// relationship: normalizeRelationship({ requested: true, notifying: false }),
// });
store = {
...store,
accounts: ImmutableMap({
'1': account,
}),
};
});
// store = {
// ...store,
// accounts: ImmutableMap({
// '1': account,
// }),
// };
// });
it('renders the unsubscribe button', () => {
render(<SubscribeButton account={account} />, null, store);
expect(screen.getByTestId('icon-button').title).toEqual(`Subscribe to notifications from @${account.acct}`);
});
});
});
});
// it('renders the unsubscribe button', () => {
// render(<SubscribeButton account={account} />, null, store);
// expect(screen.getByTestId('icon-button').title).toEqual(`Subscribe to notifications from @${account.acct}`);
// });
// });
// });
// });
});

View file

@ -126,7 +126,7 @@ const getInstanceFeatures = (instance: Instance) => {
accountNotifies: any([
v.software === MASTODON && gte(v.compatVersion, '3.3.0'),
v.software === PLEROMA && gte(v.version, '2.4.50'),
v.software === TRUTHSOCIAL,
// v.software === TRUTHSOCIAL,
]),
/**