-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix for docker pull command in versions modal * Remove function in template * Update docker pull command when tool changes * Test docker pull command by injecting a real tool and real tag into the component * Add an additional tool to database * Simplify unit test * Hotfix conflict fix * Revert "Remove enduser" This reverts commit 0aabdb9. * Revert changes again * Update database for hotfix branch
- Loading branch information
Showing
9 changed files
with
856 additions
and
306 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
describe('Public Version Modal', function() { | ||
require('./helper.js') | ||
beforeEach(function() { | ||
cy.visit(String(global.baseUrl) + "/containers/quay.io/garyluu/dockstore-cgpmap/cgpmap-cramOut") | ||
cy | ||
.get('tab') | ||
.should('have.length', 7) | ||
}); | ||
|
||
it('Change tab to versions', function() { | ||
cy | ||
.get('.nav-link') | ||
.contains('Versions') | ||
.parent() | ||
.click() | ||
|
||
cy | ||
.contains("View") | ||
.click() | ||
cy.get('form') | ||
cy.get('#dockerPullCommand').should('be.visible').should('have.value','docker pull quay.io/garyluu/dockstore-cgpmap:3.0.0-rc8') | ||
}); | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
74 changes: 74 additions & 0 deletions
74
src/app/container/version-modal/version-modal.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
import { FormsModule } from '@angular/forms'; | ||
import { ModalModule } from 'ngx-bootstrap/modal'; | ||
import { ClipboardModule } from 'ngx-clipboard'; | ||
|
||
import { ListContainersService } from '../../containers/list/list.service'; | ||
import { ContainerService } from '../../shared/container.service'; | ||
import { RefreshService } from '../../shared/refresh.service'; | ||
import { StateService } from '../../shared/state.service'; | ||
import { ContainersService } from '../../shared/swagger'; | ||
import { ParamfilesService } from '../paramfiles/paramfiles.service'; | ||
import { DateService } from './../../shared/date.service'; | ||
import { ContainertagsService } from './../../shared/swagger/api/containertags.service'; | ||
import { sampleTool1, sampleTag } from './../../test/mocked-objects'; | ||
import { | ||
ContainersStubService, | ||
ContainerStubService, | ||
ContainertagsStubService, | ||
DateStubService, | ||
ParamFilesStubService, | ||
RefreshStubService, | ||
StateStubService, | ||
} from './../../test/service-stubs'; | ||
import { VersionModalComponent } from './version-modal.component'; | ||
import { VersionModalService } from './version-modal.service'; | ||
|
||
describe('VersionModalComponent', () => { | ||
let component: VersionModalComponent; | ||
let fixture: ComponentFixture<VersionModalComponent>; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [ VersionModalComponent ], | ||
imports: [ModalModule.forRoot(), FormsModule, ClipboardModule], | ||
providers: [ | ||
{provide: ParamfilesService, useClass: ParamFilesStubService}, | ||
VersionModalService, | ||
{provide: ListContainersService, useClass: ListContainersService}, | ||
{provide: ContainerService, useClass: ContainerStubService}, | ||
{provide: ContainersService, useClass: ContainersStubService}, | ||
{provide: ContainertagsService, useClass: ContainertagsStubService}, | ||
{provide: StateService, useClass: StateStubService}, | ||
{provide: DateService, useClass: DateStubService}, | ||
{provide: RefreshService, useClass: RefreshStubService}, | ||
] | ||
}) | ||
.compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(VersionModalComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
it('should have the correct docker pull command', () => { | ||
// Inject the real tool and real tag | ||
const fakeTool = sampleTool1; | ||
fakeTool.path = 'quay.io\/wtsicgp\/dockstore-cgpmap'; | ||
component.tool = fakeTool; | ||
const fakeTag = sampleTag; | ||
fakeTag.name = '3.0.0-rc8'; | ||
component.version = fakeTag; | ||
// Manually trigger the update | ||
component.updateDockerPullCommand(); | ||
// Let it detect changes | ||
fixture.detectChanges(); | ||
// Check to see if the dockerPullCommand which is used in the template has the right docker pull command | ||
expect(component.dockerPullCommand).toEqual('docker pull quay.io/wtsicgp/dockstore-cgpmap:3.0.0-rc8'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.