Skip to content
This repository has been archived by the owner on Jun 28, 2024. It is now read-only.

Commit

Permalink
MAT-2550: Upgraded to the latest version of jQuery (#1759)
Browse files Browse the repository at this point in the history
* MAT-2550: Upgraded to the latest version of jQuery
Also fixed the favicon icon location in two template files to clean up some console noise

* MAT-2550: Removing the (unused) jQuery migrate plugin

* MAT-2550: Cleaned up the test a little and added a delay to fix the test

* MAT-2550: Fixing remaining tests

* MAT-2550: splitting the patient_builder_tests/input_views tests into two different directories to prevent sporadic GitHub Actions failures

* MAT-2550: Increasing sleep time to hopefully fix GitHub action timeout

* MAT-2550: more timeout adjustments for GitHub Actions
  • Loading branch information
Andrew Bird authored Feb 8, 2021
1 parent f7cd4ab commit 5850893
Show file tree
Hide file tree
Showing 37 changed files with 8,845 additions and 8,520 deletions.
19 changes: 16 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,24 @@ jobs:
fail_ci_if_error: true
# ----------------------------------------------------------------------

# ------- Teaspoon tests for "patient_builder_tests/input_views" directory ----------
- name: Run teaspoon tests for patient_builder_tests/input_views
# ------- Teaspoon tests for "patient_builder_tests/input_views_1" directory ----------
- name: Run teaspoon tests for patient_builder_tests/input_views_1
uses: GabrielBB/xvfb-action@v1
with:
run: bundle exec rake teaspoon DIR=patient_builder_tests/input_views
run: bundle exec rake teaspoon DIR=patient_builder_tests/input_views_1

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
file: coverage-frontend/default/lcov.info
fail_ci_if_error: true
# ----------------------------------------------------------------------

# ------- Teaspoon tests for "patient_builder_tests/input_views_2" directory ----------
- name: Run teaspoon tests for patient_builder_tests/input_views_2
uses: GabrielBB/xvfb-action@v1
with:
run: bundle exec rake teaspoon DIR=patient_builder_tests/input_views_2

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
Expand Down
2 changes: 1 addition & 1 deletion app/views/layouts/devise.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Bonnie v<%=Bonnie::Version.current()%></title>
<link rel="shortcut icon" href="/assets/favicon.ico">
<link rel="shortcut icon" href="/favicon.ico">
<%= stylesheet_link_tag :application %>
<%= javascript_include_tag :application %>
<%= csrf_meta_tag %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/layouts/doorkeeper/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Bonnie v<%=Bonnie::Version.current()%></title>
<link rel="shortcut icon" href="/assets/favicon.ico">
<link rel="shortcut icon" href="/favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<% stylesheet_link_tag "doorkeeper/application" %>
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"private": true,
"dependencies": {
"thorax": "~2.0.1",
"jquery": "~2.2.4",
"jquery": "~3.5.1",
"bootstrap": "~3.3.0",
"moment": "^2.14.1",
"font-awesome": "~4.7.0",
Expand Down
25 changes: 10 additions & 15 deletions spec/javascripts/integration/population_state_spec.js.coffee
Original file line number Diff line number Diff line change
@@ -1,17 +1,25 @@
describe "Population state between routes", ->
beforeAll ->
beforeAll (done) ->
jasmine.getJSONFixtures().clearCache()
@measureToTest = loadFhirMeasure 'fhir_measures/CMS111/CMS111.json'
bonnie.measures = new Thorax.Collections.Measures()
bonnie.measures.add @measureToTest
@patient = new Thorax.Models.Patient getJSONFixture('fhir_patients/CMS111/IPP_MSRPOPL_PASS_TEST.json'), parse: true
@measureToTest.get('patients').add @patient

it "starts with the first population", ->
@measureView = new Thorax.Views.MeasureLayout(measure: @measureToTest, patients: @measureToTest.get('patients'))
@measureView = @measureView.showMeasure()
@measureView.appendTo 'body'

# Give the measure time to render
setTimeout(() ->
done()
, 1)

afterAll ->
@measureView.remove()

it "starts with the first population", ->
populationNavs = @measureView.$('[data-toggle="tab"]')
# ensure 2 populations exists
expect(populationNavs.length).toBe(3)
Expand All @@ -21,12 +29,7 @@ describe "Population state between routes", ->
expect(active.text).toBe(@measureToTest.get('displayedPopulation').get('title'))
expect(@measureToTest.get('displayedPopulation').cid).toBe(@measureToTest.get('populations').first().cid)

@measureView.remove()

it "changes the displayedPopulation state when selected", ->
@measureView = new Thorax.Views.MeasureLayout(measure: @measureToTest, patients: @measureToTest.get('patients'))
@measureView = @measureView.showMeasure()
@measureView.appendTo 'body'
# simulate click on the measure view to select different population
@measureView.$('[data-toggle="tab"]').last().trigger('click')

Expand All @@ -37,12 +40,7 @@ describe "Population state between routes", ->
expect(active.text).toBe(@measureToTest.get('displayedPopulation').get('title'))
expect(@measureToTest.get('displayedPopulation').cid).toBe(@measureToTest.get('populations').at(2).cid)

@measureView.remove()

it "carries over changes between views", ->
@measureView = new Thorax.Views.MeasureLayout(measure: @measureToTest, patients: @measureToTest.get('patients'))
@measureView = @measureView.showMeasure()
@measureView.appendTo 'body'
# simulate click on the measure view to select different population
@measureView.$('[data-toggle="tab"]').last().trigger('click')
@measureView.remove()
Expand All @@ -64,9 +62,6 @@ describe "Population state between routes", ->
# temporarily disabled until we figure how to reset the URL
# see https://jira.mitre.org/browse/BONNIE-318
xit "resets when user goes to measures route", ->
@measureView = new Thorax.Views.MeasureLayout(measure: @measureToTest, patients: @measureToTest.get('patients'))
@measureView = @measureView.showMeasure()
@measureView.appendTo 'body'
# simulate click on the measure view to select different population
@measureView.$('[data-toggle="tab"]').last().trigger('click')
@measureView.remove()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,15 +152,23 @@ describe 'EditCriteriaView', ->
extensions = @encounterView.model.get('dataElement').fhir_resource['extension']
expect(extensions).toBeUndefined()

it 'removes an Extension', ->
it 'removes an Extension', (done) ->
displayExtensionsView = @serviceRequestView.displayExtensionsView
expect(displayExtensionsView).toBeDefined();
expect(@serviceRequestView.model.get('dataElement').fhir_resource['extension'].length).toEqual 1
# expand the extension
displayExtensionsView.$el.find("a.extension-url").click()
# click delete extension button
displayExtensionsView.$el.find("button.delete-extension-btn").click()
expect(@serviceRequestView.model.get('dataElement').fhir_resource['extension'].length).toEqual 0

modelRef = @serviceRequestView.model
setTimeout(() ->
try
# click delete extension button
displayExtensionsView.$el.find("button.delete-extension-btn").click()
expect(modelRef.get('dataElement').fhir_resource['extension'].length).toEqual 0
done()
catch err
done.fail(err)
, 1)

it 'adds an Extensions', ->
displayExtensionsView = @encounterView.addExtensionsView
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
describe 'PatientBuilderView', ->

beforeEach ->
beforeEach (done) ->
jasmine.DEFAULT_TIMEOUT_INTERVAL = 10000;
jasmine.getJSONFixtures().clearCache()
@measure = loadFhirMeasure 'fhir_measure_data/CMS104_eoc.json'
@patients = new Thorax.Collections.Patients [getJSONFixture('fhir_patients/CMS104_eoc/mickey_mouse.json')], parse: true
Expand All @@ -13,6 +14,12 @@ describe 'PatientBuilderView', ->
spyOn(@patientBuilder.model, 'materialize')
spyOn(@patientBuilder.originalModel, 'save').and.returnValue(true)
@$el = @patientBuilder.$el
setTimeout(() ->
try
done()
catch err
done.fail(err)
, 1)

afterEach ->
bonnie.measures = @bonnie_measures_old
Expand Down
2 changes: 1 addition & 1 deletion spec/teaspoon_env.rb
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ def run_specs(runner, url)
# Specify the timeout for the driver. Specs are expected to complete within
# this time frame or the run will be considered a failure. This is to avoid
# issues that can arise where tests stall.
config.driver_timeout = 600
config.driver_timeout = 800

# Specify a server to use with Rack (e.g. thin, mongrel). If nil is provided
# Rack::Server is used.
Expand Down
Loading

0 comments on commit 5850893

Please sign in to comment.