Update tests relying on actions/instance

revert-5af0e40a
Alex Gleason 2022-04-25 14:27:09 -05:00
rodzic c6456a43b6
commit 72e64780f7
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 7211D1F99744FBB7
2 zmienionych plików z 17 dodań i 17 usunięć

Wyświetl plik

@ -1,7 +1,7 @@
import * as React from 'react';
import LandingPage from '..';
import { INSTANCE_REMEMBER_SUCCESS } from '../../../actions/instance';
import { rememberInstance } from '../../../actions/instance';
import { PEPE_FETCH_INSTANCE_SUCCESS } from '../../../actions/verification';
import { render, screen, rootReducer, applyActions } from '../../../jest/test-helpers';
@ -9,8 +9,8 @@ describe('<LandingPage />', () => {
it('renders a RegistrationForm for an open Pleroma instance', () => {
const state = rootReducer(undefined, {
type: INSTANCE_REMEMBER_SUCCESS,
instance: {
type: rememberInstance.fulfilled.toString(),
payload: {
version: '2.7.2 (compatible; Pleroma 2.3.0)',
registrations: true,
},
@ -26,8 +26,8 @@ describe('<LandingPage />', () => {
it('renders "closed" message for a closed Pleroma instance', () => {
const state = rootReducer(undefined, {
type: INSTANCE_REMEMBER_SUCCESS,
instance: {
type: rememberInstance.fulfilled.toString(),
payload: {
version: '2.7.2 (compatible; Pleroma 2.3.0)',
registrations: false,
},
@ -43,8 +43,8 @@ describe('<LandingPage />', () => {
it('renders Pepe flow for an open Truth Social instance', () => {
const state = applyActions(undefined, [{
type: INSTANCE_REMEMBER_SUCCESS,
instance: {
type: rememberInstance.fulfilled.toString(),
payload: {
version: '3.4.1 (compatible; TruthSocial 1.0.0)',
registrations: false,
},
@ -65,8 +65,8 @@ describe('<LandingPage />', () => {
it('renders "closed" message for a Truth Social instance with Pepe closed', () => {
const state = applyActions(undefined, [{
type: INSTANCE_REMEMBER_SUCCESS,
instance: {
type: rememberInstance.fulfilled.toString(),
payload: {
version: '3.4.1 (compatible; TruthSocial 1.0.0)',
registrations: false,
},

Wyświetl plik

@ -1,7 +1,7 @@
import { Record } from 'immutable';
import { ADMIN_CONFIG_UPDATE_REQUEST } from 'soapbox/actions/admin';
import { INSTANCE_REMEMBER_SUCCESS } from 'soapbox/actions/instance';
import { rememberInstance } from 'soapbox/actions/instance';
import reducer from '../instance';
@ -30,11 +30,11 @@ describe('instance reducer', () => {
expect(result.toJS()).toMatchObject(expected);
});
describe('INSTANCE_REMEMBER_SUCCESS', () => {
describe('rememberInstance.fulfilled', () => {
it('normalizes Pleroma instance with Mastodon configuration format', () => {
const action = {
type: INSTANCE_REMEMBER_SUCCESS,
instance: require('soapbox/__fixtures__/pleroma-instance.json'),
type: rememberInstance.fulfilled.toString(),
payload: require('soapbox/__fixtures__/pleroma-instance.json'),
};
const result = reducer(undefined, action);
@ -59,8 +59,8 @@ describe('instance reducer', () => {
it('normalizes Mastodon instance with retained configuration', () => {
const action = {
type: INSTANCE_REMEMBER_SUCCESS,
instance: require('soapbox/__fixtures__/mastodon-instance.json'),
type: rememberInstance.fulfilled.toString(),
payload: require('soapbox/__fixtures__/mastodon-instance.json'),
};
const result = reducer(undefined, action);
@ -93,8 +93,8 @@ describe('instance reducer', () => {
it('normalizes Mastodon 3.0.0 instance with default configuration', () => {
const action = {
type: INSTANCE_REMEMBER_SUCCESS,
instance: require('soapbox/__fixtures__/mastodon-3.0.0-instance.json'),
type: rememberInstance.fulfilled.toString(),
payload: require('soapbox/__fixtures__/mastodon-3.0.0-instance.json'),
};
const result = reducer(undefined, action);