Skip to content

Commit

Permalink
Smartlink fix (#410)
Browse files Browse the repository at this point in the history
* fix smartlink functionality in case we don't know about a standard

* lint and tests fix

* lint2

* add e2e
  • Loading branch information
northdpole authored Oct 2, 2023
1 parent 158c69a commit 257ea3f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ e2e:
yarn test:e2e
killall yarn
killall flask

test:
[ -d "./venv" ] && . ./venv/bin/activate
export FLASK_APP=$(CURDIR)/cre.py
Expand Down
8 changes: 8 additions & 0 deletions application/frontend/src/test/basic-e2etest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,5 +166,13 @@ describe('App.js', () => {
);
expect(clearFilters).toContain('Clear Filters');
});

it('can smartlink', async () => {
const response = await page.goto('http://127.0.0.1:5000/smartlink/standard/CWE/1002');
expect(response.url()).toBe('http://127.0.0.1:5000/node/standard/CWE/sectionid/1002');
const redirectResponse = await page.goto('http://127.0.0.1:5000/smartlink/standard/CWE/404');
expect(redirectResponse.url()).toBe('https://cwe.mitre.org/data/definitions/404.html');
});

afterAll(async () => await browser.close());
});

0 comments on commit 257ea3f

Please sign in to comment.