Skip to content

Commit

Permalink
only skip specific tests
Browse files Browse the repository at this point in the history
  • Loading branch information
paula-stacho committed Oct 15, 2024
1 parent 0e1dadd commit 0f0678d
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 51 deletions.
1 change: 1 addition & 0 deletions packages/compass-global-writes/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"test-cov": "nyc --compact=false --produce-source-map=false -x \"**/*.spec.*\" --reporter=lcov --reporter=text --reporter=html npm run test",
"test-watch": "npm run test -- --watch",
"test-ci": "npm run test-cov",
"test-ci-electron": "npm run test-electron",
"reformat": "npm run eslint . -- --fix && npm run prettier -- --write ."
},
"dependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,59 +56,71 @@ describe('Compass GlobalWrites Plugin', function () {
expect(within(rows[2]).getByText('EMEA (Frankfurt)')).to.be.visible;
});

it('allows top level search', function () {
render(
<ShardZonesTable
shardZones={[
...shardZones,
{
zoneId: '438908',
country: 'Slovakia',
readableName: 'Slovakia',
isoCode: 'SK',
typeOneIsoCode: 'SK',
zoneName: 'Zone 2',
zoneLocations: ['Location 2'],
},
]}
/>
);
describe('search', function () {
before(function () {
if (
process.env.NODE_ENV === 'test' &&
process.env.npm_lifecycle_event === 'test-electron'
) {
// TODO(COMPASS-8368)
this.skip();
}
});
it('allows top level search', function () {
render(
<ShardZonesTable
shardZones={[
...shardZones,
{
zoneId: '438908',
country: 'Slovakia',
readableName: 'Slovakia',
isoCode: 'SK',
typeOneIsoCode: 'SK',
zoneName: 'Zone 2',
zoneLocations: ['Location 2'],
},
]}
/>
);

const searchInput = screen.getByLabelText('Search for a location');
expect(searchInput).to.be.visible;
userEvent.type(searchInput, 'Slo');
const rows = screen.getAllByRole('row');
expect(rows).to.have.lengthOf(2); // 1 header, 1 item
expect(within(rows[1]).getByText('Slovakia (SK)')).to.be.visible;
expect(within(rows[1]).getByText('Zone 2 (Location 2)')).to.be.visible;
});
const searchInput = screen.getByLabelText('Search for a location');
expect(searchInput).to.be.visible;
userEvent.type(searchInput, 'Slo');
const rows = screen.getAllByRole('row');
// screen.debug(rows[1]);
expect(rows).to.have.lengthOf(2); // 1 header, 1 item
expect(within(rows[1]).getByText('Slovakia (SK)')).to.be.visible;
expect(within(rows[1]).getByText('Zone 2 (Location 2)')).to.be.visible;
});

it('allows subZone search', function () {
render(
<ShardZonesTable
shardZones={[
...shardZones,
{
zoneId: '4389048',
country: 'Slovakia',
readableName: 'Slovakia',
isoCode: 'SK',
typeOneIsoCode: 'SK',
zoneName: 'Zone 2',
zoneLocations: ['Location 2'],
},
{
zoneId: '8908900',
country: 'Slovakia',
readableName: 'Slovakia - Bratislava',
isoCode: 'SK-BA',
typeOneIsoCode: 'SK',
zoneName: 'Zone 2',
zoneLocations: ['Location 2'],
},
]}
/>
);
it('allows subZone search', function () {
render(
<ShardZonesTable
shardZones={[
...shardZones,
{
zoneId: '4389048',
country: 'Slovakia',
readableName: 'Slovakia',
isoCode: 'SK',
typeOneIsoCode: 'SK',
zoneName: 'Zone 2',
zoneLocations: ['Location 2'],
},
{
zoneId: '8908900',
country: 'Slovakia',
readableName: 'Slovakia - Bratislava',
isoCode: 'SK-BA',
typeOneIsoCode: 'SK',
zoneName: 'Zone 2',
zoneLocations: ['Location 2'],
},
]}
/>
);
});

const searchInput = screen.getByLabelText('Search for a location');
expect(searchInput).to.be.visible;
Expand Down

0 comments on commit 0f0678d

Please sign in to comment.