Skip to content

Commit

Permalink
test(decorators): update tests for DJS v13
Browse files Browse the repository at this point in the history
  • Loading branch information
favna committed Jul 20, 2021
1 parent bfd3f04 commit 99233b4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/decorators/tests/djs/RequiresPermissions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ describe('RequiresPermissions', () => {

describe('WITH channel === GUILD_TEXT', () => {
test('GIVEN has permission THEN returns resolved', async () => {
const result = await instance.getValue(buildMessage('text', 'SEND_MESSAGES', 'ATTACH_FILES'));
const result = await instance.getValue(buildMessage('GUILD_TEXT', 'SEND_MESSAGES', 'ATTACH_FILES'));

expect(result).toBe('Resolved');
});

test('GIVEN lacking 1 permission THEN throws UserError', async () => {
const result = instance.getValue(buildMessage('text', 'SEND_MESSAGES'));
const result = instance.getValue(buildMessage('GUILD_TEXT', 'SEND_MESSAGES'));

await expect(result).rejects.toThrowError(
new UserError({
Expand All @@ -65,7 +65,7 @@ describe('RequiresPermissions', () => {
});

test('GIVEN lacking 2 permissions THEN throws UserError', async () => {
const result = instance.getValue(buildMessage('text'));
const result = instance.getValue(buildMessage('GUILD_TEXT'));

await expect(result).rejects.toThrowError(
new UserError({
Expand All @@ -80,7 +80,7 @@ describe('RequiresPermissions', () => {

describe('WITH channel === DM', () => {
test('GIVEN no additional permissions THEN resolves', async () => {
const result = await instance.getValue(buildMessage('dm'));
const result = await instance.getValue(buildMessage('DM'));

expect(result).toBe('Resolved');
});
Expand All @@ -99,7 +99,7 @@ describe('RequiresPermissions', () => {

describe('WITH channel === DM', () => {
test('GIVEN no additional permissions THEN resolves', async () => {
const result = instance.getValue(buildMessage('dm'));
const result = instance.getValue(buildMessage('DM'));

await expect(result).rejects.toThrowError(
new UserError({
Expand Down

0 comments on commit 99233b4

Please sign in to comment.