sequenceserver 3.0.1 → 3.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (64) hide show
  1. checksums.yaml +4 -4
  2. data/bin/sequenceserver +2 -2
  3. data/lib/sequenceserver/api_errors.rb +56 -2
  4. data/lib/sequenceserver/blast/job.rb +20 -3
  5. data/lib/sequenceserver/blast/report.rb +74 -86
  6. data/lib/sequenceserver/blast/tasks.rb +38 -0
  7. data/lib/sequenceserver/blast.rb +6 -0
  8. data/lib/sequenceserver/config.rb +54 -20
  9. data/lib/sequenceserver/database.rb +13 -0
  10. data/lib/sequenceserver/makeblastdb.rb +16 -2
  11. data/lib/sequenceserver/report.rb +0 -6
  12. data/lib/sequenceserver/routes.rb +66 -25
  13. data/lib/sequenceserver/sequence.rb +34 -7
  14. data/lib/sequenceserver/server.rb +1 -1
  15. data/lib/sequenceserver/version.rb +1 -1
  16. data/lib/sequenceserver.rb +1 -1
  17. data/public/404.html +1 -1
  18. data/public/css/app.css +121 -0
  19. data/public/css/app.min.css +1 -0
  20. data/public/css/sequenceserver.css +0 -148
  21. data/public/css/sequenceserver.min.css +3 -3
  22. data/public/js/circos.js +2 -2
  23. data/public/js/collapse_preferences.js +37 -0
  24. data/public/js/databases.js +65 -37
  25. data/public/js/databases_tree.js +2 -1
  26. data/public/js/dnd.js +37 -50
  27. data/public/js/download_fasta.js +1 -0
  28. data/public/js/form.js +79 -50
  29. data/public/js/grapher.js +23 -37
  30. data/public/js/hits_overview.js +2 -2
  31. data/public/js/kablammo.js +2 -2
  32. data/public/js/length_distribution.js +3 -3
  33. data/public/js/null_plugins/grapher/histogram.js +25 -0
  34. data/public/js/null_plugins/options.js +3 -0
  35. data/public/js/null_plugins/query_stats.js +11 -0
  36. data/public/js/null_plugins/report_plugins.js +6 -1
  37. data/public/js/null_plugins/search_header_plugin.js +4 -0
  38. data/public/js/options.js +161 -56
  39. data/public/js/query.js +85 -59
  40. data/public/js/report.js +1 -1
  41. data/public/js/search.js +2 -0
  42. data/public/js/search_button.js +67 -56
  43. data/public/js/sidebar.js +10 -1
  44. data/public/js/tests/database.spec.js +5 -5
  45. data/public/js/tests/form.spec.js +98 -0
  46. data/public/js/tests/mock_data/databases.json +5 -5
  47. data/public/js/tests/mocks/circos.js +6 -0
  48. data/public/js/tests/report.spec.js +4 -3
  49. data/public/js/tests/search_query.spec.js +16 -6
  50. data/public/sequenceserver-report.min.js +46 -24
  51. data/public/sequenceserver-search.min.js +57 -13
  52. data/public/sequenceserver_logo.webp +0 -0
  53. data/views/blastn_options.erb +66 -66
  54. data/views/blastp_options.erb +59 -59
  55. data/views/blastx_options.erb +68 -68
  56. data/views/layout.erb +61 -3
  57. data/views/search.erb +33 -38
  58. data/views/search_layout.erb +153 -0
  59. data/views/tblastn_options.erb +57 -57
  60. data/views/tblastx_options.erb +64 -64
  61. metadata +51 -22
  62. data/lib/sequenceserver/makeblastdb-modified-with-cache.rb +0 -345
  63. data/public/SequenceServer_logo.png +0 -0
  64. data/public/js/tests/advanced_parameters.spec.js +0 -36
@@ -1,7 +1,6 @@
1
1
  /* eslint-disable no-unused-vars */
2
2
  /* eslint-disable no-undef */
3
3
  import { render, screen, fireEvent } from '@testing-library/react';
4
- import { SearchQueryWidget } from '../query';
5
4
  import { Form } from '../form';
6
5
  import { AMINO_ACID_SEQUENCE, NUCLEOTIDE_SEQUENCE, FASTQ_SEQUENCE, FASTA_OF_FASTQ_SEQUENCE } from './mock_data/sequences';
7
6
  import '@testing-library/jest-dom/extend-expect';
@@ -11,14 +10,25 @@ let container;
11
10
  let inputEl;
12
11
 
13
12
  describe('SEARCH COMPONENT', () => {
13
+ let csrfMetaTag;
14
+
14
15
  beforeEach(() => {
16
+ csrfMetaTag = document.createElement('meta');
17
+ csrfMetaTag.setAttribute('name', '_csrf');
18
+ csrfMetaTag.setAttribute('content', 'test-token');
19
+ document.head.appendChild(csrfMetaTag);
15
20
  container = render(<Form onSequenceTypeChanged={() => { }
16
21
  } />).container;
17
22
  inputEl = screen.getByRole('textbox', { name: '' });
18
23
  });
19
24
 
25
+ afterEach(() => {
26
+ // Remove the CSRF meta tag after each test to clean up
27
+ document.head.removeChild(csrfMetaTag);
28
+ });
29
+
20
30
  test('should render the search component textarea', () => {
21
- expect(inputEl).toHaveClass('form-control');
31
+ expect(inputEl).toBeInTheDocument();
22
32
  });
23
33
 
24
34
  test('clear button should only become visible if textarea is not empty', () => {
@@ -33,7 +43,7 @@ describe('SEARCH COMPONENT', () => {
33
43
  test('should correctly detect the amino-acid sequence type and show notification', () => {
34
44
  // populate search
35
45
  fireEvent.change(inputEl, { target: { value: AMINO_ACID_SEQUENCE } });
36
- const activeNotification = container.querySelector('.notification.active');
46
+ const activeNotification = container.querySelector('[data-role=notification].active');
37
47
  expect(activeNotification.id).toBe('protein-sequence-notification');
38
48
  const alertWrapper = activeNotification.children[0];
39
49
  expect(alertWrapper).toHaveTextContent('Detected: amino-acid sequence(s).');
@@ -42,7 +52,7 @@ describe('SEARCH COMPONENT', () => {
42
52
  test('should correctly detect the nucleotide sequence type and show notification', () => {
43
53
  // populate search
44
54
  fireEvent.change(inputEl, { target: { value: NUCLEOTIDE_SEQUENCE } });
45
- const activeNotification = container.querySelector('.notification.active');
55
+ const activeNotification = container.querySelector('[data-role=notification].active');
46
56
  const alertWrapper = activeNotification.children[0];
47
57
  expect(activeNotification.id).toBe('nucleotide-sequence-notification');
48
58
  expect(alertWrapper).toHaveTextContent('Detected: nucleotide sequence(s).');
@@ -50,7 +60,7 @@ describe('SEARCH COMPONENT', () => {
50
60
 
51
61
  test('should correctly detect the mixed sequences and show error notification', () => {
52
62
  fireEvent.change(inputEl, { target: { value: `${NUCLEOTIDE_SEQUENCE}${AMINO_ACID_SEQUENCE}` } });
53
- const activeNotification = container.querySelector('.notification.active');
63
+ const activeNotification = container.querySelector('[data-role=notification].active');
54
64
  expect(activeNotification.id).toBe('mixed-sequence-notification');
55
65
  const alertWrapper = activeNotification.children[0];
56
66
  expect(alertWrapper).toHaveTextContent('Error: mixed nucleotide and amino-acid sequences detected.');
@@ -58,7 +68,7 @@ describe('SEARCH COMPONENT', () => {
58
68
 
59
69
  test('should correctly detect FASTQ and convert it to FASTA', () => {
60
70
  fireEvent.change(inputEl, { target: { value: FASTQ_SEQUENCE } });
61
- const activeNotification = container.querySelector('.notification.active');
71
+ const activeNotification = container.querySelector('[data-role=notification].active');
62
72
  const alertWrapper = activeNotification.children[0];
63
73
  expect(activeNotification.id).toBe('fastq-sequence-notification');
64
74
  expect(alertWrapper).toHaveTextContent('Detected FASTQ and automatically converted to FASTA.');