Skip to content

Commit

Permalink
Dev
Browse files Browse the repository at this point in the history
  • Loading branch information
adanski committed Dec 7, 2023
1 parent d6e6408 commit 6d673e3
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x, 21.x]
node-version: [20.x]

steps:
- name: Checkout
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x, 21.x]
node-version: [20.x]

steps:
- name: Checkout
Expand Down
30 changes: 15 additions & 15 deletions test/comments-element.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ describe('CommentsElement', () => {
expect(sendButton.classList.contains('enabled')).toBe(false);
});

it('Should be possible to add a new main level comment', async () => {
it('Should be possible to add a new main level comment', () => {
mainTextarea.value = multilineText;
mainTextarea.dispatchEvent(new InputEvent('input'));

Expand All @@ -261,7 +261,7 @@ describe('CommentsElement', () => {
checkOrder(queryCommentsAll('#comment-list > li.comment'), [idOfNewComment, '3', '2', '1']);
});

it('Should be possible to add a new main level comment with attachments', async () => {
it('Should be possible to add a new main level comment with attachments', () => {
mainTextarea.value = multilineText;
mainTextarea.dispatchEvent(new InputEvent('input'));

Expand Down Expand Up @@ -296,7 +296,7 @@ describe('CommentsElement', () => {
expect(replyField).toBe(null);
});

it('Should be possible to reply', async () => {
it('Should be possible to reply', () => {
mostPopularComment.querySelector<HTMLElement>('.reply')!.click();
const replyField: CommentingFieldElement = mostPopularComment.querySelector('.commenting-field')!;
expect(isNil(replyField)).toBe(false);
Expand Down Expand Up @@ -330,7 +330,7 @@ describe('CommentsElement', () => {
expect(mostPopularComment.querySelectorAll('li.comment.visible').length).toBe(2);
});

it('Should be possible to reply with attachments', async () => {
it('Should be possible to reply with attachments', () => {
mostPopularComment.querySelector<HTMLElement>('.reply')!.click();
const replyField: CommentingFieldElement = mostPopularComment.querySelector('.commenting-field')!;

Expand Down Expand Up @@ -366,7 +366,7 @@ describe('CommentsElement', () => {
expect(isNil(replyField)).toBe(true);
});

it('Should be possible to re-reply', async () => {
it('Should be possible to re-reply', () => {
const childComment: CommentElement = mostPopularComment.querySelector('.child-comments li.comment[data-id="9"]')!;
childComment.querySelector<HTMLElement>('.reply')!.click();
const replyField: CommentingFieldElement = mostPopularComment.querySelector('.commenting-field')!;
Expand Down Expand Up @@ -399,7 +399,7 @@ describe('CommentsElement', () => {
expect(mostPopularComment.querySelectorAll('li.comment.visible').length).toBe(2);
});

it('Should be possible to re-reply to a hidden reply', async () => {
it('Should be possible to re-reply to a hidden reply', () => {
mostPopularComment.querySelector<HTMLElement>('.toggle-all')!.click();
const childComment = mostPopularComment.querySelector('.child-comments li.comment')!;
childComment.querySelector<HTMLElement>('.reply')!.click();
Expand Down Expand Up @@ -480,11 +480,11 @@ describe('CommentsElement', () => {
expect(ownComment.outerHTML).toBe(cloneOfOwnComment.outerHTML);
});

it('Should be possible to edit a main level comment', async () => {
await testEditingComment(ownComment.commentModel.id);
it('Should be possible to edit a main level comment', () => {
testEditingComment(ownComment.commentModel.id);
});

it('Should be possible to edit a reply', async () => {
it('Should be possible to edit a reply', () => {
[...ownComment.querySelectorAll<HTMLElement>('.reply')].at(-1)!.click();
const replyText = 'This is a re-reply';

Expand All @@ -500,7 +500,7 @@ describe('CommentsElement', () => {
// Test editing the reply
let reply: CommentElement = [...ownComment.querySelector('.child-comments')!.children].at(-1) as CommentElement;
let replyId = reply.commentModel.id;
await testEditingComment(replyId);
testEditingComment(replyId);
});

it(`Should not let the user save the comment if it hasn't changed`, () => {
Expand Down Expand Up @@ -539,7 +539,7 @@ describe('CommentsElement', () => {
expect(deleteButton.classList.contains('enabled')).toBe(true);
});

it('Should be possible to delete a main level comment', async () => {
it('Should be possible to delete a main level comment', () => {
const commentId = '3';
const ownComment: CommentElement = queryComments(`#comment-list li.comment[data-id="${commentId}"]`)!;

Expand All @@ -554,7 +554,7 @@ describe('CommentsElement', () => {
expect(commentViewModel.getComment(commentId)!.content).toBe('Deleted');
});

it('Should be possible to delete a reply', async () => {
it('Should be possible to delete a reply', () => {
const commentId = '10';
const ownComment: CommentElement = queryComments(`#comment-list li.comment[data-id="${commentId}"]`)!;
const outermostParent: CommentElement = findParentsBySelector<CommentElement>(ownComment, 'li.comment').last()!;
Expand All @@ -571,7 +571,7 @@ describe('CommentsElement', () => {
expect(commentViewModel.getComment(commentId)!.content).toBe('Deleted');
});

it('Should be possible to delete a reply that has re-replies', async () => {
it('Should be possible to delete a reply that has re-replies', () => {
const commentId = '8';
const ownComment: CommentElement = queryComments(`#comment-list li.comment[data-id="${commentId}"]`)!;
const outermostParent: CommentElement = findParentsBySelector<CommentElement>(ownComment, 'li.comment').last()!;
Expand All @@ -593,7 +593,7 @@ describe('CommentsElement', () => {
expect(commentViewModel.getChildComments(outermostParent.commentModel.id).length).toBe(5);
});

it('Should be possible to delete attachments', async () => {
it('Should be possible to delete attachments', () => {
const ownCommentModel = commentViewModel.getComment('10')!;
const ownComment: CommentElement = queryComments('#comment-list li.comment[data-id="10"]')!;

Expand Down Expand Up @@ -779,7 +779,7 @@ describe('CommentsElement', () => {
return [...elements].map((commentEl) => commentEl.getAttribute('data-id')!);
}

async function testEditingComment(id: string): Promise<void> {
function testEditingComment(id: string): void {
let ownComment: CommentElement = queryComments(`#comment-list li.comment[data-id="${id}"]`)!;
const editButton: HTMLElement = ownComment.querySelector('.edit')!;

Expand Down

0 comments on commit 6d673e3

Please sign in to comment.