Skip to content

chore(modelarmor): enabled floor settings tests #4123

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions model-armor/test/modelarmor.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -371,9 +371,8 @@ describe('Model Armor tests', () => {

after(async () => {
for (const templateName of templatesToDelete) {
// TODO(b/424365799): Uncomment below code once the mentioned issue is resolved
// Disable floor settings to restore original state
// await disableFloorSettings();
await disableFloorSettings();

await deleteTemplate(templateName);
}
Expand Down Expand Up @@ -940,51 +939,52 @@ describe('Model Armor tests', () => {

// =================== Floor Settings Tests ===================

// TODO(b/424365799): Enable below tests once the mentioned issue is resolved

it.skip('should get organization floor settings', async () => {
it('should get organization floor settings', async () => {
const getOrganizationFloorSettings = require('../snippets/getOrganizationFloorSettings');

const output = await getOrganizationFloorSettings.main(organizationId);

const expectedName = `organizations/${organizationId}/locations/global/floorSetting`;
assert.equal(output.name, expectedName);
assert.exists(output.enableFloorSettingEnforcement);
});

it.skip('should get folder floor settings', async () => {
it('should get folder floor settings', async () => {
const getFolderFloorSettings = require('../snippets/getFolderFloorSettings');

const output = await getFolderFloorSettings.main(folderId);

// Check for expected name format in output
const expectedName = `folders/${folderId}/locations/global/floorSetting`;
assert.equal(output.name, expectedName);
assert.exists(output.enableFloorSettingEnforcement);
});

it.skip('should get project floor settings', async () => {
it('should get project floor settings', async () => {
const getProjectFloorSettings = require('../snippets/getProjectFloorSettings');

const output = await getProjectFloorSettings.main(projectId);
// Check for expected name format in output
const expectedName = `projects/${projectId}/locations/global/floorSetting`;
assert.equal(output.name, expectedName);
assert.exists(output.enableFloorSettingEnforcement);
});

it.skip('should update organization floor settings', async () => {
it('should update organization floor settings', async () => {
const updateOrganizationFloorSettings = require('../snippets/updateOrganizationFloorSettings');
const output = await updateOrganizationFloorSettings.main(organizationId);
// Check that the enableFloorSettingEnforcement=true
assert.equal(output.enableFloorSettingEnforcement, true);
});

it.skip('should update folder floor settings', async () => {
it('should update folder floor settings', async () => {
const updateFolderFloorSettings = require('../snippets/updateFolderFloorSettings');
const output = await updateFolderFloorSettings.main(folderId);
// Check that the enableFloorSettingEnforcement=true
assert.equal(output.enableFloorSettingEnforcement, true);
});

it.skip('should update project floor settings', async () => {
it('should update project floor settings', async () => {
const updateProjectFloorSettings = require('../snippets/updateProjectFloorSettings');
const output = await updateProjectFloorSettings.main(projectId);
// Check that the enableFloorSettingEnforcement=true
Expand Down