Skip to content

Commit

Permalink
add github action, add unit test for duplicate tags case in subject, …
Browse files Browse the repository at this point in the history
…fix unit test in uppercase tags in subject, fix project name in package-lock.json
  • Loading branch information
bishoy-magdy committed Sep 7, 2022
1 parent 8f07966 commit 52c5005
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 3 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/Email-Plugin-CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Email Plugin Continuous Integration

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [14.x]

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm install
- run: npm test
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 14 additions & 1 deletion test/noteLocationBySubject.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ describe('Naive Case.', ()=>{
const loc = noteLocationBySubject('@JOPLIN #JOPLIN');
const ans = {
folders: ['JOPLIN'],
tags: ['JOPLIN'],
tags: ['joplin'],
};
expect(loc).toEqual(ans);
});
Expand Down Expand Up @@ -176,3 +176,16 @@ describe('Irregular spaces.', ()=>{
expect(loc).toEqual(ans);
});
});

describe('Subject with duplicate tags.', ()=>{
it('should ignore duplicates tags.', ()=>{
const loc = noteLocationBySubject('email subject @joplin #joplin #gmail #joplin #tag #TAG');

const ans = {
folders: ['joplin'],
tags: ['joplin', 'gmail', 'tag'],
};

expect(loc).toEqual(ans);
});
});

0 comments on commit 52c5005

Please sign in to comment.