mirror of
https://github.com/roleypoly/roleypoly.git
synced 2025-04-25 03:49:11 +00:00
chore: fix failing tests
This commit is contained in:
parent
e4e4bb9024
commit
ee7ac47bc2
2 changed files with 5 additions and 5 deletions
|
@ -2,18 +2,18 @@ jest.unmock('./ServerMasthead');
|
||||||
|
|
||||||
import { shallow } from 'enzyme';
|
import { shallow } from 'enzyme';
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { guild } from 'roleypoly/common/types/storyData';
|
import { mastheadSlugs } from 'roleypoly/common/types/storyData';
|
||||||
import { ServerMasthead } from './ServerMasthead';
|
import { ServerMasthead } from './ServerMasthead';
|
||||||
import { Editable } from './ServerMasthead.styled';
|
import { Editable } from './ServerMasthead.styled';
|
||||||
|
|
||||||
it('shows Edit Server when editable is true', () => {
|
it('shows Edit Server when editable is true', () => {
|
||||||
const view = shallow(<ServerMasthead editable={true} guild={guild} />);
|
const view = shallow(<ServerMasthead editable={true} guild={mastheadSlugs[0]} />);
|
||||||
|
|
||||||
expect(view.find(Editable).length).not.toBe(0);
|
expect(view.find(Editable).length).not.toBe(0);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('hides Edit Server when editable is true', () => {
|
it('hides Edit Server when editable is true', () => {
|
||||||
const view = shallow(<ServerMasthead editable={false} guild={guild} />);
|
const view = shallow(<ServerMasthead editable={false} guild={mastheadSlugs[0]} />);
|
||||||
|
|
||||||
expect(view.find(Editable).length).toBe(0);
|
expect(view.find(Editable).length).toBe(0);
|
||||||
});
|
});
|
||||||
|
|
|
@ -6,8 +6,8 @@ jest.unmock('roleypoly/design-system/atoms/role')
|
||||||
import { shallow } from 'enzyme';
|
import { shallow } from 'enzyme';
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import {
|
import {
|
||||||
guild,
|
|
||||||
guildData,
|
guildData,
|
||||||
|
mastheadSlugs,
|
||||||
member,
|
member,
|
||||||
mockCategorySingle,
|
mockCategorySingle,
|
||||||
roleCategory,
|
roleCategory,
|
||||||
|
@ -23,7 +23,7 @@ it('unselects the rest of a category in single mode', () => {
|
||||||
guildData: { ...guildData, categories: [mockCategorySingle] },
|
guildData: { ...guildData, categories: [mockCategorySingle] },
|
||||||
member: { ...member, roles: [] },
|
member: { ...member, roles: [] },
|
||||||
roles: [...roleCategory, ...roleCategory2],
|
roles: [...roleCategory, ...roleCategory2],
|
||||||
guild: guild,
|
guild: mastheadSlugs[0],
|
||||||
onSubmit: jest.fn(),
|
onSubmit: jest.fn(),
|
||||||
editable: false,
|
editable: false,
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue